### Question:
GenomePosition implements Serializable, Comparable<GenomePosition> { public int differenceTo(GenomePosition pos) { if (chr != pos.chr) throw new InvalidCoordinateException("Coordinates are on different chromosomes " + this + " vs. " + pos); if (pos.strand != strand) pos = pos.withStrand(strand); return (this.pos - pos.pos); } GenomePosition(ReferenceDictionary refDict, Strand strand, int chr, int pos);  GenomePosition(ReferenceDictionary refDict, Strand strand, int chr, int pos, PositionType positionType);  GenomePosition(GenomePosition other);  GenomePosition(GenomePosition other, Strand strand); ReferenceDictionary getRefDict(); Strand getStrand(); int getChr(); int getPos(); GenomePosition withStrand(Strand strand); boolean isLt(GenomePosition other); boolean isLeq(GenomePosition other); boolean isGt(GenomePosition other); boolean isGeq(GenomePosition other); boolean isEq(GenomePosition other); int differenceTo(GenomePosition pos); int differenceTo(GenomeInterval itv); GenomePosition shifted(int delta); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); int compareTo(GenomePosition other);  }### Answer:
@Test public void testDifferenceToPositionForward() { GenomePosition posL = new GenomePosition(refDict, Strand.FWD, 1, 100, PositionType.ONE_BASED); GenomePosition posR = new GenomePosition(refDict, Strand.FWD, 1, 101, PositionType.ONE_BASED); Assert.assertEquals(posL.differenceTo(posR), -1); Assert.assertEquals(posL.differenceTo(posL), 0); Assert.assertEquals(posR.differenceTo(posL), 1); }
@Test public void testDifferenceToPositionReverse() { GenomePosition posL = new GenomePosition(refDict, Strand.REV, 1, 100, PositionType.ONE_BASED); GenomePosition posR = new GenomePosition(refDict, Strand.REV, 1, 101, PositionType.ONE_BASED); Assert.assertEquals(posL.differenceTo(posR), -1); Assert.assertEquals(posL.differenceTo(posL), 0); Assert.assertEquals(posR.differenceTo(posL), 1); }