InMemoryPath implements Path { @Override public Path resolve(Path other) { final List<String> list = new ArrayList<>(); final List<String> otherString = Arrays.asList(other.toString().split(sep)); list.addAll(pathElements); list.addAll(otherString); return new InMemoryPath(list); } private  InMemoryPath(final List<String> pathElements);  InMemoryPath(final String relativePath); @Override boolean equals(final Object obj); @Override int hashCode(); @Override String toString(); @Override Path getParent(); @Override Path normalize(); @Override Path resolve(Path other); @Override Path resolve(String other); @Override Path getFileName(); @Override URI toUri(); @Override Path relativize(Path other); @Override Path resolveSibling(Path other); @Override Path resolveSibling(String other); @Override Iterator<Path> iterator(); @Override Path getName(int index); @Override FileSystem getFileSystem(); @Override Path toAbsolutePath(); @Override Path toRealPath(LinkOption... options); @Override File toFile(); @Override WatchKey register(WatchService watcher, WatchEvent.Kind<?>[] events, WatchEvent.Modifier... modifiers); @Override WatchKey register(WatchService watcher, WatchEvent.Kind<?>[] events); @Override int compareTo(Path other); @Override boolean isAbsolute(); @Override Path getRoot(); @Override int getNameCount(); @Override Path subpath(int beginIndex, int endIndex); @Override boolean startsWith(Path other); @Override boolean startsWith(String other); @Override boolean endsWith(Path other); @Override boolean endsWith(String other);  }
@Test public void resolveString() { final InMemoryPath path = new InMemoryPath("./xyz"); assertEquals(new InMemoryPath("./xyz/../less/main.css"), path.resolve("../less/main.css")); }
@Test public void resolvePath() { final InMemoryPath path1 = new InMemoryPath("./xyz"); final InMemoryPath path2 = new InMemoryPath("./abc/../less/main.css"); assertEquals(new InMemoryPath("./xyz/./abc/../less/main.css"), path1.resolve(path2)); }