Samples extends UnsignedIntLEByteValue { public static Samples of(byte... values) { return new Samples(values); } private  Samples(byte... values); private  Samples(long value); private  Samples(String value); private  Samples(ByteBuf byteBuf); static Samples of(byte... values); static Samples of(long value); static Samples of(String value); static Samples of(ByteBuf byteBuf); static final int NUM_BYTES; }
@Test public void ofBytes() { assertEquals(0L, Samples.of(NULL_BYTE, NULL_BYTE, NULL_BYTE, NULL_BYTE).getAsLong()); assertThrows(IllegalArgumentException.class, () -> Samples.of(NULL_BYTE, NULL_BYTE, NULL_BYTE, NULL_BYTE, NULL_BYTE)); }
@Test public void ofLong() { assertByte(Samples.of(1), "0x01000000"); assertByte(Samples.of(65535), "0xffff0000"); assertThrows(IllegalArgumentException.class, () -> Samples.of(-1)); assertThrows(IllegalArgumentException.class, () -> Samples.of(4294967296L)); }
@Test public void ofString() { assertByte(Samples.of("1"), "0x01000000"); }
@Test public void testToString() { assertThat(Samples.of("1").toString(), containsString("longValue=1,")); }