GeneticInterval implements ChromosomalRegion { @Override public String toString() { return String.format("chr%d:%d-%d", chromosome, start, 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 testToString() { assertThat(instance.toString(), equalTo("chr2:123-456")); }