### Question:
Length { public void increment() { switch (status) { case INT: { if (iValue > INT_MAX) { lValue = iValue; status = Status.LONG; increment(); return; } iValue += 8; return; } case LONG: { if (lValue > LONG_MAX) { biValue = BigInteger.valueOf(lValue); status = Status.BIGINT; increment(); return; } lValue += 8L; return; } case BIGINT: { biValue = biValue.add(BigInteger.valueOf(8)); return; } } throw new IllegalStateException(); } Length(final int size); void increment(); void writeTo(final byte[] out, final int index);  }### Answer:
@Test void increment() throws Exception { final Length len = new Length(8); len.iValue = Integer.MAX_VALUE - 9; assertEquals(Integer.MAX_VALUE - 9, len.iValue); assertEquals(0L, len.lValue); assertEquals(Status.INT, len.status); len.increment(); assertEquals(Integer.MAX_VALUE - 1, len.iValue); assertEquals(0L, len.lValue); assertEquals(Status.INT, len.status); len.increment(); assertEquals(Integer.MAX_VALUE - 1, len.iValue); assertEquals(Integer.MAX_VALUE + 7L, len.lValue); assertEquals(Status.LONG, len.status); }