@Test public void testIterator() throws Exception { assertThat(new Normalized(EmptyPath.INSTANCE), new IsEmptyIterable()); assertThat(new Normalized(new EncodedPath(new Precoded("."))), Matchers.contains((UriEncoded) IdempotentEncoded.CURRENT, IdempotentEncoded.EMPTY)); assertThat(new Normalized(new EncodedPath(new Precoded(".."))), Matchers.contains((UriEncoded) IdempotentEncoded.PARENT, IdempotentEncoded.EMPTY)); assertThat(new Normalized(new EncodedPath(new Precoded("/"))), Matchers.contains((UriEncoded) new Encoded(""), new Encoded(""))); assertThat(new Normalized(new EncodedPath(new Precoded("/a"))), Matchers.contains((UriEncoded) IdempotentEncoded.EMPTY, new Encoded("a"))); assertThat(new Normalized(new EncodedPath(new Precoded("/a/"))), Matchers.contains((UriEncoded) IdempotentEncoded.EMPTY, new Encoded("a"), IdempotentEncoded.EMPTY)); assertThat(new Normalized(new EncodedPath(new Precoded("/a/b"))), Matchers.contains((UriEncoded) IdempotentEncoded.EMPTY, new Encoded("a"), new Encoded("b"))); assertThat(new Normalized(new EncodedPath(new Precoded("a"))), Matchers.contains((UriEncoded) new Encoded("a"))); assertThat(new Normalized(new EncodedPath(new Precoded("a/"))), Matchers.contains((UriEncoded) new Encoded("a"), IdempotentEncoded.EMPTY)); assertThat(new Normalized(new EncodedPath(new Precoded("a/b"))), Matchers.contains((UriEncoded) new Encoded("a"), new Encoded("b"))); assertThat(new Normalized(new EncodedPath(new Precoded("/../a/b"))), Matchers.contains((UriEncoded) IdempotentEncoded.EMPTY, new Encoded("a"), new Encoded("b"))); assertThat(new Normalized(new EncodedPath(new Precoded("/../a/../b"))), Matchers.contains((UriEncoded) IdempotentEncoded.EMPTY, new Encoded("b"))); assertThat(new Normalized(new EncodedPath(new Precoded("../a/b"))), Matchers.contains((UriEncoded) IdempotentEncoded.PARENT, new Encoded("a"), new Encoded("b"))); assertThat(new Normalized(new EncodedPath(new Precoded("../a/../b"))), Matchers.contains((UriEncoded) IdempotentEncoded.PARENT, new Encoded("b"))); assertThat(new Normalized(new EncodedPath(new Precoded("/../../a/../b/"))), Matchers.contains((UriEncoded) IdempotentEncoded.EMPTY, new Encoded("b"), IdempotentEncoded.EMPTY)); assertThat(new Normalized(new EncodedPath(new Precoded("../../c"))), Matchers.contains((UriEncoded) IdempotentEncoded.PARENT, IdempotentEncoded.PARENT, new Encoded("c"))); assertThat(new Normalized(new EncodedPath(new Precoded("/../../c/"))), Matchers.contains((UriEncoded) IdempotentEncoded.EMPTY, new Encoded("c"), IdempotentEncoded.EMPTY)); assertThat(new Normalized(new EncodedPath(new Precoded("./a/b/./././c"))), Matchers.contains((UriEncoded) new Encoded("a"), new Encoded("b"), new Encoded("c"))); assertThat(new Normalized(new EncodedPath(new Precoded("a/../b"))), Matchers.contains((UriEncoded) new Encoded("b"))); assertThat(new Normalized(new EncodedPath(new Precoded("a/b/../.."))), Matchers.contains((UriEncoded) IdempotentEncoded.CURRENT, IdempotentEncoded.EMPTY)); assertThat(new Normalized(new EncodedPath(new Precoded("a/b/../../"))), Matchers.contains((UriEncoded) IdempotentEncoded.CURRENT, IdempotentEncoded.EMPTY)); assertThat(new Normalized(new EncodedPath(new Precoded("a/b/../../.."))), Matchers.contains((UriEncoded) IdempotentEncoded.PARENT, IdempotentEncoded.EMPTY)); assertThat(new Normalized(new EncodedPath(new Precoded("a/b/../../../"))), Matchers.contains((UriEncoded) IdempotentEncoded.PARENT, IdempotentEncoded.EMPTY)); assertThat(new Normalized(new EncodedPath(new Precoded("a/b/../../../c"))), Matchers.contains((UriEncoded) IdempotentEncoded.PARENT, new Encoded("c"))); assertThat(new Normalized(new EncodedPath(new Precoded("../a/../../b"))), Matchers.contains((UriEncoded) IdempotentEncoded.PARENT, IdempotentEncoded.PARENT, new Encoded("b"))); assertThat(new Normalized(new EncodedPath(new Precoded("./a/./../b"))), Matchers.contains((UriEncoded) new Encoded("b"))); assertThat(new Normalized(new EncodedPath(new Precoded("../a/../../b/../"))), Matchers.contains((UriEncoded) IdempotentEncoded.PARENT, IdempotentEncoded.PARENT, IdempotentEncoded.EMPTY)); }
@Override public Iterator<UriEncoded> iterator() { if (mDelegate.isEmpty()) { return EmptyIterator.instance(); } return Collections.unmodifiableList(normalize(mDelegate.iterator())).iterator(); }
Normalized implements Path { @Override public Iterator<UriEncoded> iterator() { if (mDelegate.isEmpty()) { return EmptyIterator.instance(); } return Collections.unmodifiableList(normalize(mDelegate.iterator())).iterator(); } }
Normalized implements Path { @Override public Iterator<UriEncoded> iterator() { if (mDelegate.isEmpty()) { return EmptyIterator.instance(); } return Collections.unmodifiableList(normalize(mDelegate.iterator())).iterator(); } Normalized(Path delegate); }
Normalized implements Path { @Override public Iterator<UriEncoded> iterator() { if (mDelegate.isEmpty()) { return EmptyIterator.instance(); } return Collections.unmodifiableList(normalize(mDelegate.iterator())).iterator(); } Normalized(Path delegate); @Override boolean isEmpty(); @Override boolean isAbsolute(); @Override Iterator<UriEncoded> iterator(); }
Normalized implements Path { @Override public Iterator<UriEncoded> iterator() { if (mDelegate.isEmpty()) { return EmptyIterator.instance(); } return Collections.unmodifiableList(normalize(mDelegate.iterator())).iterator(); } Normalized(Path delegate); @Override boolean isEmpty(); @Override boolean isAbsolute(); @Override Iterator<UriEncoded> iterator();  }