OrderedCode { public void writeInfinity() { writeTrailingBytes(INFINITY_ENCODED); } OrderedCode();  OrderedCode(byte[] encodedByteArray); void writeBytes(byte[] value); void writeBytesDecreasing(byte[] value); void writeNumIncreasing(long value); void writeNumIncreasing(UnsignedInteger unsignedInt); void writeNumDecreasing(long value); void writeNumDecreasing(UnsignedInteger unsignedInt); void writeSignedNumIncreasing(long val); void writeSignedNumDecreasing(long val); void writeInfinity(); void writeInfinityDecreasing(); void writeTrailingBytes(byte[] value); byte[] readBytes(); byte[] readBytesDecreasing(); long readNumIncreasing(); long readNumDecreasing(); long readSignedNumIncreasing(); long readSignedNumDecreasing(); boolean readInfinity(); boolean readInfinityDecreasing(); byte[] readTrailingBytes(); byte[] getEncodedBytes(); boolean hasRemainingEncodedBytes();  }
@Test public void testWriteInfinity() { OrderedCode orderedCode = new OrderedCode(); try { orderedCode.readInfinity(); fail("Expected IllegalArgumentException."); } catch (IllegalArgumentException e) { } orderedCode.writeInfinity(); assertTrue(orderedCode.readInfinity()); try { orderedCode.readInfinity(); fail("Expected IllegalArgumentException."); } catch (IllegalArgumentException e) { } }