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