### Question:
RangeLongBlock implements Comparable<RangeLongBlock>, Iterable<Long> { public RangeRelationType getRelation(RangeLongBlock block) { RangeRelationType result = null; if (block.myEndValue < myStartValue) { if (block.myEndValue == myStartValue - 1) { result = RangeRelationType.BORDERS_BEFORE; } else { result = RangeRelationType.BEFORE; } } else if (block.myStartValue > myEndValue) { if (block.myStartValue - 1 == myEndValue) { result = RangeRelationType.BORDERS_AFTER; } else { result = RangeRelationType.AFTER; } } else if (equals(block)) { result = RangeRelationType.EQUAL; } else { if (block.myStartValue >= myStartValue && block.myEndValue <= myEndValue) { result = RangeRelationType.SUBSET; } else if (block.myStartValue <= myStartValue && block.myEndValue >= myEndValue) { result = RangeRelationType.SUPERSET; } else if (block.myStartValue < myStartValue && block.myEndValue <= myEndValue) { result = RangeRelationType.OVERLAPS_FRONT_EDGE; } else { result = RangeRelationType.OVERLAPS_BACK_EDGE; } } return result; } RangeLongBlock(long value);  RangeLongBlock(long startValue, long endValue);  RangeLongBlock(RangeLongBlock other); static List<RangeLongBlock> createRangeLongBlocks(Collection<? extends Long> values); static List<RangeLongBlock> createRangeLongBlocks(long[] values); static List<RangeLongBlock> createRangeLongBlocks(Long[] values); static List<RangeLongBlock> createSubBlocksByRemovingValue(RangeLongBlock block, long valueToRemove); static boolean isContiguous(long[] values); static RangeLongBlock merge(RangeLongBlock one, RangeLongBlock two); boolean borders(long value); boolean borders(RangeLongBlock block); @Override int compareTo(RangeLongBlock o); boolean containsValue(long value); @Override boolean equals(Object obj); boolean formsContiguousRange(RangeLongBlock other); long getEnd(); RangeRelationType getRelation(RangeLongBlock block); long getStart(); @Override int hashCode(); RangeLongBlock intersection(RangeLongBlock other); boolean isAfter(RangeLongBlock other); boolean isBefore(RangeLongBlock other); @Override Iterator<Long> iterator(); boolean overlaps(RangeLongBlock other); int size(); @Override String toString();  }### Answer:
@Test public void testGetRelation() { RangeLongBlock block = new RangeLongBlock(5, 10); RangeLongBlock before = new RangeLongBlock(1, 3); RangeLongBlock borderBefore = new RangeLongBlock(1, 4); RangeLongBlock overlapLeading = new RangeLongBlock(1, 5); RangeLongBlock equals = new RangeLongBlock(5, 10); RangeLongBlock subset = new RangeLongBlock(6, 9); RangeLongBlock superset = new RangeLongBlock(4, 11); RangeLongBlock overlapTrailing = new RangeLongBlock(9, 11); RangeLongBlock borderAfter = new RangeLongBlock(11, 12); RangeLongBlock after = new RangeLongBlock(12, 13); Assert.assertEquals(RangeRelationType.BEFORE, block.getRelation(before)); Assert.assertEquals(RangeRelationType.BORDERS_BEFORE, block.getRelation(borderBefore)); Assert.assertEquals(RangeRelationType.OVERLAPS_FRONT_EDGE, block.getRelation(overlapLeading)); Assert.assertEquals(RangeRelationType.EQUAL, block.getRelation(equals)); Assert.assertEquals(RangeRelationType.SUBSET, block.getRelation(subset)); Assert.assertEquals(RangeRelationType.SUPERSET, block.getRelation(superset)); Assert.assertEquals(RangeRelationType.OVERLAPS_BACK_EDGE, block.getRelation(overlapTrailing)); Assert.assertEquals(RangeRelationType.BORDERS_AFTER, block.getRelation(borderAfter)); Assert.assertEquals(RangeRelationType.AFTER, block.getRelation(after)); }