That looks correct to me. Have a look at the API for
LinkedHashSet and find the add method, and that gives the details. Do you really need to return a List; can you return a Set?
Change the body of the for-each loop to read this, temporarily, as a
testing strategy:
System.out.printf("%b ", replica.add(dto));//test
That ought to print true whenever you add, and false whenever you encounter a duplicate. If it won't print false anywhere, check the equals() and hashCode() methods of the DTO class to verify that they have been overridden correctly. They must fulfil the specification of the
Object class.