### Question:
PathIndexingService { public void indexObjects(Path listPath) { try (Stream<String> stream = Files.lines(listPath)) { indexObjects(stream); } catch (IOException e) { throw new RepositoryException("Failed to open list file " + listPath, e); } }  void indexObjects(Path listPath); void indexObjectsFromPath(Path objsPath); void indexDatastreams(Path listPath); void indexDatastreamsFromPath(Path datastreamsPath); void createIndexTable(); void setPathIndex(PathIndex pathIndex);  }### Answer:
@Test public void indexObjects() throws Exception { String uuid1 = "8f7e4761-bc50-48bf-9335-f89c4854feb5"; String path1 = "/path/to/fedora/objects/2010/0330/16/58/uuid_8f7e4761-bc50-48bf-9335-f89c4854feb5"; String uuid2 = "09f6b320-d183-480c-a93a-d9a6c4a8fd2e"; String path2 = "/path/to/fedora/objects/2016/1122/01/09/uuid_09f6b320-d183-480c-a93a-d9a6c4a8fd2e"; Path listPath = createListFile( path1, path2); service.indexObjects(listPath); assertPathEquals(path1, pathIndex.getPath(PIDs.get(uuid1))); assertPathEquals(path2, pathIndex.getPath(PIDs.get(uuid2))); assertEquals(2, pathIndex.countFiles(OBJECT_TYPE)); }
@Test public void indexObjectsWithNonUuid() throws Exception { String path1 = "/path/to/fedora/objects/2010/0330/16/58/admin_REPOSITORY_SOFTWARE"; String uuid2 = "09f6b320-d183-480c-a93a-d9a6c4a8fd2e"; String path2 = "/path/to/fedora/objects/2016/1122/01/09/uuid_09f6b320-d183-480c-a93a-d9a6c4a8fd2e"; Path listPath = createListFile( path1, path2); service.indexObjects(listPath); assertPathEquals(path2, pathIndex.getPath(PIDs.get(uuid2))); assertEquals(1, pathIndex.countFiles(OBJECT_TYPE)); }