### Question:
Chromosome implements Comparable<Chromosome> { @Override public boolean equals(Object o) { if (!(o instanceof Chromosome)) { return false; } Chromosome c = (Chromosome) o; return (gene.equals(c.gene) && fitness == c.fitness); } Chromosome(String gene); String getGene(); int getFitness(); Chromosome mutate(); Chromosome[] mate(Chromosome mate); @Override int compareTo(Chromosome c); @Override boolean equals(Object o); @Override int hashCode();  }### Answer:
@Test public void testEquals() { Chromosome c1 = new Chromosome("Hello, world!"); Chromosome c2 = new Chromosome("H5p&J;!l<X\\7l"); assertTrue(c1.equals(c1)); assertTrue(c2.equals(c2)); assertFalse(c1.equals(c2)); assertFalse(c1.equals(null)); assertFalse(c1.equals(new Object())); assertFalse(c2.equals(c1)); assertFalse(c2.equals(null)); assertFalse(c2.equals(new Object())); }