CommandDirectories { public Path relativizeWithUserDirectory(Path path) { return Paths.get(System.getProperty("user.dir")).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 testRelativizeWithUserDirectory() { Path path = Paths.get("target/sub/file1"); CommandDirectories instance = new CommandDirectories("source", "target"); Path expResult = Paths.get("target/sub/file1"); Path result = instance.relativizeWithUserDirectory(path); assertEquals(expResult, result); }