how to compare two lists in java 8 code example
Example: java compare lists
List<String> firstList=Arrays.asList("Hello","World");
List<String> secondList=new ArrayList<>(firstList);
System.out.println(firstList.equals(secondList));//true
secondList.add("other element");
System.out.println(firstList.equals(secondList));//false