### Question:
NamedByteArrayResource extends ByteArrayResource { @Override public int hashCode() { return super.hashCode(); } NamedByteArrayResource(byte[] byteArray, String filename); @Override String getFilename(); @Override boolean equals(Object other); @Override int hashCode();  }### Answer:
@Test public void hashCodeTest() { final byte[] bytes = new byte[]{0x01, 0x02, 0x03}; final String filename = "abc.txt"; final var resource1 = new NamedByteArrayResource(bytes, filename); final var resource2 = new NamedByteArrayResource(bytes, filename); assertNotSame(resource1, resource2); assertEquals(resource1.hashCode(), resource2.hashCode()); }