GeneticInterval implements ChromosomalRegion { @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final GeneticInterval other = (GeneticInterval) obj; if (this.chromosome != other.chromosome) { return false; } if (this.start != other.start) { return false; } return this.end == other.end; } GeneticInterval(int chromosome, int start, int end); static GeneticInterval parseString(String interval); @Override int getChromosome(); @Override int getStart(); @Override int getEnd(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }
@Test public void testEquals() { GeneticInterval other = new GeneticInterval(CHR, START, END); assertThat(instance.equals(other), is(true)); }
@Test public void testObjectNotEquals() { String other = "wibble"; assertThat(instance.equals(other), is(false)); }
@Test public void testNullNotEquals() { assertThat(instance.equals(null), is(false)); }
@Test public void testChrNotEquals() { GeneticInterval other = new GeneticInterval((byte) 4, START, END); assertThat(instance.equals(other), is(false)); }
@Test public void testStartNotEquals() { GeneticInterval other = new GeneticInterval(CHR, 345, END); assertThat(instance.equals(other), is(false)); }
@Test public void testEndNotEquals() { GeneticInterval other = new GeneticInterval(CHR, START, 124); assertThat(instance.equals(other), is(false)); }