OrderedCode { public boolean hasRemainingEncodedBytes() { return encodedArrays.size() != 0; } 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 testHasRemainingEncodedBytes() { byte[] bytes = {'a', 'b', 'c'}; long number = 12345; OrderedCode orderedCode = new OrderedCode(); assertFalse(orderedCode.hasRemainingEncodedBytes()); orderedCode.writeBytes(bytes); assertTrue(orderedCode.hasRemainingEncodedBytes()); assertArrayEquals(orderedCode.readBytes(), bytes); assertFalse(orderedCode.hasRemainingEncodedBytes()); orderedCode.writeNumIncreasing(number); assertTrue(orderedCode.hasRemainingEncodedBytes()); assertEquals(orderedCode.readNumIncreasing(), number); assertFalse(orderedCode.hasRemainingEncodedBytes()); orderedCode.writeSignedNumIncreasing(number); assertTrue(orderedCode.hasRemainingEncodedBytes()); assertEquals(orderedCode.readSignedNumIncreasing(), number); assertFalse(orderedCode.hasRemainingEncodedBytes()); orderedCode.writeInfinity(); assertTrue(orderedCode.hasRemainingEncodedBytes()); assertTrue(orderedCode.readInfinity()); assertFalse(orderedCode.hasRemainingEncodedBytes()); orderedCode.writeTrailingBytes(bytes); assertTrue(orderedCode.hasRemainingEncodedBytes()); assertArrayEquals(orderedCode.readTrailingBytes(), bytes); assertFalse(orderedCode.hasRemainingEncodedBytes()); orderedCode.writeBytes(bytes); orderedCode.writeBytes(bytes); assertTrue(orderedCode.hasRemainingEncodedBytes()); assertArrayEquals(orderedCode.readBytes(), bytes); assertArrayEquals(orderedCode.readBytes(), bytes); assertFalse(orderedCode.hasRemainingEncodedBytes()); }