### Question:
Genotype { @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Genotype other = (Genotype) obj; if (alleleNumbers == null) { if (other.alleleNumbers != null) return false; } else if (!alleleNumbers.equals(other.alleleNumbers)) return false; return true; } Genotype(Collection<Integer> alleleNumbers); ImmutableList<Integer> getAlleleNumbers(); int getPloidy(); boolean isDiploid(); boolean isMonoploid(); boolean isHet(); boolean isHomRef(); boolean isHomAlt(); boolean isNotObserved(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); static final int NO_CALL; static final int REF_CALL; }### Answer:
@Test public void testEquals() { Genotype one = new Genotype(Arrays.asList(1, 2)); Genotype two = new Genotype(Arrays.asList(1, 2)); Genotype three = new Genotype(Arrays.asList(1, 1)); Genotype four = new Genotype(Collections.singletonList(1)); assertTrue(one.equals(two)); assertFalse(one.equals(three)); assertFalse(one.equals(four)); }