ByteArrayResource implements Resource { @Override public Stream<String> getAllLocations() { return Stream.of(location); } ByteArrayResource(String location, byte[] bytes); @Override Stream<String> getAllLocations(); byte[] getBytes(); @Override URL getResource(String location); @Override InputStream getResourceAsStream(String location);  }
@Test void testGetAllLocations() { ByteArrayResource resource = new ByteArrayResource("mylocation", null); assertEquals(1, resource.getAllLocations().count()); }