I have two collections of the same object, Collection oldSet and Collection newSet. The required logic is as follow:
Collection oldSet
Collection newSet
For comaparing a list or set we can use Arrays.equals(object[], object[]). It will check for the values only. To get the Object[] we can use Collection.toArray() method.
Arrays.equals(object[], object[])
Object[]
Collection.toArray()