### Question:
PathListReportExecutor implements ReportExecutor { List<Object> getResources(final List<String> paths) { return Optional.ofNullable(paths) .map(Collection::stream) .orElseGet(Stream::empty) .map(path -> resourceResolver.getResource(path)) .filter(Objects::nonNull) .collect(Collectors.toList()); }  @Override String getDetails(); @Override String getParameters(); @Override ResultsPage getAllResults(); @Override ResultsPage getResults(); @Override void setConfiguration(final Resource config); @Override void setPage(final int page);  }### Answer:
@Test public void testGetResourcesNullOrEmptyList() { PathListReportExecutor executor = new PathListReportExecutor(); assertEquals(Collections.EMPTY_LIST, executor.getResources(null)); assertEquals(Collections.EMPTY_LIST, executor.getResources(new ArrayList<>())); }
@Test public void testGetResourcesReturnEmptyListWhenResourceNotFound() { PathListReportExecutor executor = new PathListReportExecutor(); executor.resourceResolver = mock(ResourceResolver.class); assertEquals(Collections.EMPTY_LIST, executor.getResources(TEST_PATHS)); }
@Test public void testGetResources() { PathListReportExecutor executor = new PathListReportExecutor(); final ResourceResolver rr = mock(ResourceResolver.class); ArrayList<Object> expectedResult = new ArrayList<>(); for (String path : TEST_PATHS) { final Resource resource = mock(Resource.class); doReturn(resource).when(rr).getResource(path); expectedResult.add(resource); } executor.resourceResolver = rr; assertEquals(expectedResult, executor.getResources(TEST_PATHS)); }