### Question:
PathResolve { public void next() { if (isEnd()) { return; } int nodeBegin = ++position; while (!isEnd() && path.charAt(position) != '/') { position++; checkEnd(); } current = path.substring(nodeBegin, position); }  boolean isEnd(); void next();  }### Answer:
@Test public void assertNext() { final String path = "/test/a/bb/ccc/ddd"; PathResolve pathResolve = new PathResolve(path); pathResolve.next(); assertThat(pathResolve.getCurrent(), is("test")); pathResolve.next(); assertThat(pathResolve.getCurrent(), is("a")); pathResolve.next(); assertThat(pathResolve.getCurrent(), is("bb")); pathResolve.next(); assertThat(pathResolve.getCurrent(), is("ccc")); pathResolve.next(); assertThat(pathResolve.getCurrent(), is("ddd")); }