### Question:
RangeLongBlock implements Comparable<RangeLongBlock>, Iterable<Long> { protected void expand(long value) { if (value < myStartValue - 1 || value > myEndValue + 1) { throw new IllegalArgumentException("Expanding RangeLongBlock Can Only Be Done With Neighboring Values"); } if (value == myStartValue - 1) { myStartValue = value; } else if (value == myEndValue + 1) { myEndValue = value; } } 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 testExpand() { RangeLongBlock aBlock = new RangeLongBlock(3, 5); boolean gotIllegalArgumentException = false; try { aBlock.expand(1); } catch (IllegalArgumentException e) { gotIllegalArgumentException = true; } Assert.assertTrue(gotIllegalArgumentException); gotIllegalArgumentException = false; try { aBlock.expand(7); } catch (IllegalArgumentException e) { gotIllegalArgumentException = true; } Assert.assertTrue(gotIllegalArgumentException); aBlock.expand(2); Assert.assertEquals(2, aBlock.getStart()); aBlock.expand(6); Assert.assertEquals(6, aBlock.getEnd()); }