### Question:
ConnectionId { public static Pair<Optional<ConnectionId>, Optional<ConnectionId>> readPair(final ByteBuf bb) { final int cil = bb.readByte() & 0xFF; final int dcil = firstLength(cil); final int scil = lastLength(cil); return Pair.of(readOptional(dcil, bb), readOptional(scil, bb)); } ConnectionId(final byte[] id); static ConnectionId random(); static ConnectionId read(final int length, final ByteBuf bb); static Optional<ConnectionId> readOptional(final int length, final ByteBuf bb); static Pair<Optional<ConnectionId>, Optional<ConnectionId>> readPair(final ByteBuf bb); static int lastLength(final int cil); static void write(
      final Optional<ConnectionId> first, final Optional<ConnectionId> second, final ByteBuf bb); void write(final ByteBuf bb); int getLength(); byte[] asBytes(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); static final int LENGTH; }### Answer:
@Test public void readPair() { final ByteBuf bb = Unpooled.buffer(); bb.writeByte(0xdf); final byte[] b16 = new byte[16]; bb.writeBytes(b16); final byte[] b18 = new byte[18]; Arrays.fill(b18, (byte) 1); bb.writeBytes(b18); final Pair<Optional<ConnectionId>, Optional<ConnectionId>> cids = ConnectionId.readPair(bb); assertArrayEquals(b16, cids.getFirst().get().asBytes()); assertArrayEquals(b18, cids.getSecond().get().asBytes()); }