### Question:
Interval implements ParamHandler { public int inverseTranslate(int index) { return inverseTranslate(index, true); } Interval();  Interval(final int start, final int length); boolean contains(int index); int getLength(); void setLength(final int length); int getStart(); void setStart(final int start); int size(); int translate(int index); int translate(int index, boolean check); int inverseTranslate(int index); int inverseTranslate(int index, boolean check); @Override ParamSet getParams(); @Override void setParams(final ParamSet paramSet); @Override String toString(); int getEnd(); static final String START_FLAG; static final String LENGTH_FLAG; }### Answer:
@Test public void testInverseTranslate() { for(int i = 0; i < length; i++) { final int index = interval.inverseTranslate(i + start); Assert.assertEquals(i, index); } }
@Test(expected = ArrayIndexOutOfBoundsException.class) public void testInverseTranslateOutOfBoundsAbove() { interval.inverseTranslate(start + length); }
@Test(expected = ArrayIndexOutOfBoundsException.class) public void testInverseTranslateOutOfBoundsBelow() { interval.inverseTranslate(start - 1); }