Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.Arrays;

import java.util.List;

public class Main {
    public static <T> boolean isListIdentical(List<T> listA, List<T> listB) {
        if (listA == null || listB == null) {
            throw new IllegalArgumentException("input list should not be null");
        }

        Object[] arrayA = listA.toArray();
        Object[] arrayB = listB.toArray();

        boolean ret = Arrays.equals(arrayA, arrayB);

        return ret;
    }
}