OrderedCode { public void writeInfinity() { writeTrailingBytes(INFINITY_ENCODED); } OrderedCode();  OrderedCode(byte[] encodedByteArray); void writeBytes(byte[] value); void writeNumIncreasing(long value); void writeSignedNumIncreasing(long val); void writeInfinity(); void writeTrailingBytes(byte[] value); byte[] readBytes(); long readNumIncreasing(); long readSignedNumIncreasing(); boolean readInfinity(); byte[] readTrailingBytes(); byte[] readBytes(int len); byte[] getEncodedBytes(); boolean hasRemainingEncodedBytes(); static final byte ESCAPE1; static final byte NULL_CHARACTER; static final byte SEPARATOR; static final byte ESCAPE2; static final byte INFINITY; static final byte FF_CHARACTER; static final byte[] ESCAPE1_SEPARATOR; }
@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) { } }