ByteValue implements ByteReadable { @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof ByteValue)) return false; ByteValue byteValue = (ByteValue) o; return Arrays.equals(value, byteValue.value); } protected  ByteValue(byte... value); protected  ByteValue(ByteBuf byteBuf); static void checkUnsignedBounds(long value, int numberOfBytes); static void checkUnsignedBounds(BigInteger value, int numberOfBytes); @Override byte[] getBytes(); @Override ByteBuf getByteBuf(); @Override long getCalculatedLength(); static ByteValue of(byte... values); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test public void equals() { ByteValue a = new ByteValue(((byte) 0x1)); ByteValue b = new ByteValue(((byte) 0x1)); ByteValue c = new ByteValue(((byte) 0x2)); byte array[] = {(byte) 0x1}; assertThat(a.equals(a), is(true)); assertThat(a.equals(b), is(true)); assertThat(a.equals(c), is(false)); assertThat(a.equals(1), is(false)); assertThat(a.equals((byte) 1), is(false)); assertThat(a.equals(array), is(false)); }