### Question:
HexArray implements Serializable { @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final HexArray other = (HexArray) obj; if (!Arrays.equals(getData(), other.data)) { return false; } return true; } HexArray(byte... data); static String toHex(final byte[] data); static String toHex(final byte[] data, final int len); static String toHexShort(final byte[] data, final int maxLen); static byte[] fromHex(String hex); @Override String toString(); byte[] getData(); @Override boolean equals(Object obj); @Override int hashCode();  }### Answer:
@Test public void testEquals() { HexArray hexArray = new HexArray(new byte[]{1, 2, 3, 4}); assertEquals(hexArray, new HexArray(new byte[]{1, 2, 3, 4})); assertNotEquals(hexArray, new HexArray(new byte[]{1})); assertNotEquals(hexArray, ""); assertNotEquals(hexArray, null); assertEquals(hexArray.hashCode(), new HexArray(new byte[]{1, 2, 3, 4}).hashCode()); }