@Test public void testAllBytesZeroToUuidParsingIsCorrect() { final List<Byte> packet = new ArrayList<>( asList( (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xFF ) ); final UUID uuid = converter.consume(packet); assertEquals( fromString("00000000-0000-0000-0000-000000000000"), uuid ); assertEquals( singletonList((byte) 0xFF), packet ); }
@Override public UUID consume(@NonNull List<Byte> packet) { for (int i = 0; i < UUID_BYTE_SIZE; i++) { bytes[i] = packet.remove(0); } final ByteBuffer byteBuffer = ByteBuffer.wrap(bytes); return new UUID(byteBuffer.getLong(), byteBuffer.getLong()); }
UuidFieldConverter implements IFieldConverter<UUID> { @Override public UUID consume(@NonNull List<Byte> packet) { for (int i = 0; i < UUID_BYTE_SIZE; i++) { bytes[i] = packet.remove(0); } final ByteBuffer byteBuffer = ByteBuffer.wrap(bytes); return new UUID(byteBuffer.getLong(), byteBuffer.getLong()); } }
UuidFieldConverter implements IFieldConverter<UUID> { @Override public UUID consume(@NonNull List<Byte> packet) { for (int i = 0; i < UUID_BYTE_SIZE; i++) { bytes[i] = packet.remove(0); } final ByteBuffer byteBuffer = ByteBuffer.wrap(bytes); return new UUID(byteBuffer.getLong(), byteBuffer.getLong()); }  }
UuidFieldConverter implements IFieldConverter<UUID> { @Override public UUID consume(@NonNull List<Byte> packet) { for (int i = 0; i < UUID_BYTE_SIZE; i++) { bytes[i] = packet.remove(0); } final ByteBuffer byteBuffer = ByteBuffer.wrap(bytes); return new UUID(byteBuffer.getLong(), byteBuffer.getLong()); }  @Override UUID consume(@NonNull List<Byte> packet); @Override void insert(@NonNull List<Byte> packet, @NonNull Object value); @Override void insertMask(@NonNull List<Byte> packet, byte maskBit); @Override boolean canParse(@NonNull Class<?> clazz); @Override boolean canParse(int numberOfBytes); }
UuidFieldConverter implements IFieldConverter<UUID> { @Override public UUID consume(@NonNull List<Byte> packet) { for (int i = 0; i < UUID_BYTE_SIZE; i++) { bytes[i] = packet.remove(0); } final ByteBuffer byteBuffer = ByteBuffer.wrap(bytes); return new UUID(byteBuffer.getLong(), byteBuffer.getLong()); }  @Override UUID consume(@NonNull List<Byte> packet); @Override void insert(@NonNull List<Byte> packet, @NonNull Object value); @Override void insertMask(@NonNull List<Byte> packet, byte maskBit); @Override boolean canParse(@NonNull Class<?> clazz); @Override boolean canParse(int numberOfBytes);  }