### Question:
DefaultTemporalGeometricPrimitive extends DefaultTemporalPrimitive implements TemporalGeometricPrimitive, Separation { @Override public Duration distance(final TemporalGeometricPrimitive other) { Duration response = null; long diff = 0L; if (this.relativePosition(other).equals(RelativePosition.BEFORE) || this.relativePosition(other).equals(RelativePosition.AFTER)) { if (this instanceof Instant && other instanceof Instant) { diff = Math.min(Math.abs(((Instant) other).getDate().getTime() - ((Instant) this).getDate().getTime()), Math.abs(((Instant) this).getDate().getTime() - ((Instant) other).getDate().getTime())); } else { if (this instanceof Instant && other instanceof Period) { diff = Math.min(Math.abs(((Period) other).getBeginning().getDate().getTime() - ((Instant) this).getDate().getTime()), Math.abs(((Period) other).getEnding().getDate().getTime() - ((Instant) this).getDate().getTime())); } else { if (this instanceof Period && other instanceof Instant) { diff = Math.min(Math.abs(((Instant) other).getDate().getTime() - ((Period) this).getEnding().getDate().getTime()), Math.abs(((Instant) other).getDate().getTime() - ((Period) this).getBeginning().getDate().getTime())); } else { if (this instanceof Period && other instanceof Period) { diff = Math.min(Math.abs(((Period) other).getEnding().getDate().getTime() - ((Period) this).getBeginning().getDate().getTime()), Math.abs(((Period) other).getBeginning().getDate().getTime() - ((Period) this).getEnding().getDate().getTime())); } } } } } else { if (this.relativePosition(other).equals(RelativePosition.BEGINS) || this.relativePosition(other).equals(RelativePosition.BEGUN_BY) || this.relativePosition(other).equals(RelativePosition.CONTAINS) || this.relativePosition(other).equals(RelativePosition.DURING) || this.relativePosition(other).equals(RelativePosition.ENDED_BY) || this.relativePosition(other).equals(RelativePosition.ENDS) || this.relativePosition(other).equals(RelativePosition.EQUALS) || this.relativePosition(other).equals(RelativePosition.MEETS) || this.relativePosition(other).equals(RelativePosition.MET_BY) || this.relativePosition(other).equals(RelativePosition.OVERLAPPED_BY) || this.relativePosition(other).equals(RelativePosition.OVERLAPS)) { diff = 0L; } } response = new DefaultPeriodDuration(Math.abs(diff)); return response; } DefaultTemporalGeometricPrimitive(Map<String, ?> properties); protected  DefaultTemporalGeometricPrimitive(); protected  DefaultTemporalGeometricPrimitive(final TemporalGeometricPrimitive object); @Override Duration distance(final TemporalGeometricPrimitive other); @Override Duration length();  }### Answer:
@Test public void testDistance() { TemporalGeometricPrimitive other; }