### Question:
VFSRegistryHelper { public List<Object> readEntries(final Path rootPath, final DirectoryStream.Filter<Path> filter) throws Exception { final List<Object> entries = new ArrayList<>(); for (Path path : ioService.newDirectoryStream(rootPath, filter)) { try { entries.add(readEntry(path)); } catch (Exception e) { logger.error("An error was produced while processing entry for path: " + path, e); throw e; } } return entries; } VFSRegistryHelper(); @Inject  VFSRegistryHelper(final VFSMarshallerRegistry marshallerRegistry,
                             final @Named("ioStrategy") IOService ioService,
                             final @Named("systemFS") FileSystem fileSystem); Path ensureDirectory(final String directory); String md5Hex(String content); void storeEntry(final Path path,
                           final Object value); Object readEntry(final Path path); List<Object> readEntries(final Path rootPath,
                                    final DirectoryStream.Filter<Path> filter); void writeBatch(final Path path,
                           final String content); void deleteBatch(final Path path);  }### Answer:
@Test public void testReadEntries() throws Exception { prepareReadEntries(); List<Object> result = registryHelper.readEntries(rootPath, filter); assertEquals(expectedObjects, result); for (Path path : entryPaths) { verify(registryHelper, times(1)).readEntry(path); } }
@Test public void testReadEntriesWithError() throws Exception { prepareReadEntries(); int failingIndex = 5; when(marshaller.unmarshal(entries.get(failingIndex).getContent())).thenThrow(new IOException(ERROR_MESSAGE)); expectedException.expectMessage(ERROR_MESSAGE); registryHelper.readEntries(rootPath, filter); for (int i = 0; i < failingIndex; i++) { verify(registryHelper, times(1)); } }