### Question:
RangeLongBlock implements Comparable<RangeLongBlock>, Iterable<Long> { public RangeLongBlock intersection(RangeLongBlock other) { RangeLongBlock intersection = null; RangeRelationType relation = getRelation(other); switch (relation) { case AFTER: case BEFORE: case BORDERS_AFTER: case BORDERS_BEFORE: break; case EQUAL: case SUPERSET: intersection = new RangeLongBlock(myStartValue, myEndValue); break; case OVERLAPS_BACK_EDGE: intersection = new RangeLongBlock(other.myStartValue, myEndValue); break; case OVERLAPS_FRONT_EDGE: intersection = new RangeLongBlock(myStartValue, other.myEndValue); break; case SUBSET: intersection = new RangeLongBlock(other.myStartValue, other.myEndValue); break; default: break; } return intersection; } 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 testIntersection() { RangeLongBlock block = new RangeLongBlock(5, 10); RangeLongBlock before = new RangeLongBlock(1, 3); RangeLongBlock intersect = block.intersection(before); Assert.assertNull(intersect); RangeLongBlock borderBefore = new RangeLongBlock(1, 4); intersect = block.intersection(borderBefore); Assert.assertNull(intersect); RangeLongBlock overlapLeading = new RangeLongBlock(1, 6); intersect = block.intersection(overlapLeading); Assert.assertEquals(5, intersect.getStart()); Assert.assertEquals(6, intersect.getEnd()); RangeLongBlock equals = new RangeLongBlock(5, 10); intersect = block.intersection(equals); Assert.assertEquals(5, intersect.getStart()); Assert.assertEquals(10, intersect.getEnd()); RangeLongBlock subset = new RangeLongBlock(6, 9); intersect = block.intersection(subset); Assert.assertEquals(6, intersect.getStart()); Assert.assertEquals(9, intersect.getEnd()); RangeLongBlock superset = new RangeLongBlock(4, 11); intersect = block.intersection(superset); Assert.assertEquals(5, intersect.getStart()); Assert.assertEquals(10, intersect.getEnd()); RangeLongBlock overlapTrailing = new RangeLongBlock(9, 11); intersect = block.intersection(overlapTrailing); Assert.assertEquals(9, intersect.getStart()); Assert.assertEquals(10, intersect.getEnd()); RangeLongBlock borderAfter = new RangeLongBlock(11, 12); intersect = block.intersection(borderAfter); Assert.assertNull(intersect); RangeLongBlock after = new RangeLongBlock(12, 13); intersect = block.intersection(after); Assert.assertNull(intersect); }