compare list items in java 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