Posted in Java

Remove Duplicate Objects from a List using Java

In this post, I will show you how to remove duplicate objects from a List using Java’s Comparator interface implementation based on multiple fields in a POJO. You can also check the duplicate objects in a list by overriding hashCode() and equals() methods in the POJO class. In other words, you are going to get the unique objects from the…

Continue Reading... Remove Duplicate Objects from a List using Java
Posted in Java

Find Duplicate Objects in a List using Java

In this post, I will show you how to find duplicate objects in a List using Java’s Comparator interface implementation based on multiple fields in a POJO. Prerequisites The following configurations are required in order to run the application Eclipse JDK 1.8 Have maven installed and configured Junit, Mockito, PowerMockito dependency in pom.xml Now we will see the below steps…

Continue Reading... Find Duplicate Objects in a List using Java