Merge Array With Extra Space

// 2, 4, [] []
    // [2] 3, {4}
    // [3]x
    public static void merge(Integer[] arr1, int len, Integer[] arr2){
        if(arr1 != null && arr2 != null){
            int len2 = arr2.length;
            for(int i=len-1; i>=0; i--){
                arr1[i+len2] = arr1[i];    
            }
            int p1 = len2;
            int p2 = 0; 
            int k = 0;

            while(p2 < len2 || p1 < len + len2){
                if(p2 >= len2){
                    arr1[k] = arr1[p1];
                    p1++;
                }else if(p1 >= len + len2){
                    arr1[k] = arr2[p2];
                    p2++;
                }else{
                    if(arr1[p1] < arr2[p2]){
                        arr1[k] = arr1[p1];
                        p1++;
                    }else{
                        arr1[k] = arr2[p2];
                        p2++;
                    }
                }
                k++;
            }
        }
    }