I am setting up a chromosome with the use of the custom gene implementation  with random generation of integers which is later used to retrieve an object to be set as the gene.
How ever at some points two or three random integers generation is the same integer value so the chromosome consists duplicate objects.

I want to avoid having duplicate objects in the chromosome, will the compare-to method in Custom-Gene class help. Any ideas?