CommandDirectories { public Path relativizeWithSourceDirectory(Path path) { return sourceDirectoryPath.relativize(path.toAbsolutePath()); } CommandDirectories(String sourceDirectoryPathString);  CommandDirectories(String sourceDirectoryPathString, String targetDirectoryPathString); Path resolveWithTargetDirectory(Path pathInSourceDirectory); Path resolveWithTargetDirectoryAndCreateParentDirectories(Path pathInSourceDirectory); Path relativizeWithSourceDirectory(Path path); Path relativizeWithTargetDirectory(Path path); Path relativizeWithUserDirectory(Path path); List<Path> listFilesWithExtensionInSourceDirectory(String... extensions); Path getSourceDirectoryPath(); Path getTargetDirectoryPath();  }
@Test public void testRelativizeWithSourceDirectory() { Path path = Paths.get("source/sub/file1"); CommandDirectories instance = new CommandDirectories("source", "target"); Path expResult = Paths.get("sub/file1"); Path result = instance.relativizeWithSourceDirectory(path); assertEquals(expResult, result); }