@Test public void testGetParents$slashURI_open() throws Exception { URI base=uri("http: List<URI> parents = URIHelper.getParents(base); assertThat(parents,notNullValue()); assertThat(parents,contains(base,this.p0,this.p1,this.p2,this.p3)); }
public static List<URI> getParents(final URI uri) { checkNotNull(uri,"URI cannot be null"); Set<URI> parents = Sets.newLinkedHashSet(); parents.add(uri); if(uri.isAbsolute() && !uri.isOpaque()) { URI base=current(uri); while(!isRoot(base)) { parents.add(base); base=parent(base); } parents.add(base); } return Lists.newArrayList(parents); }
URIHelper { public static List<URI> getParents(final URI uri) { checkNotNull(uri,"URI cannot be null"); Set<URI> parents = Sets.newLinkedHashSet(); parents.add(uri); if(uri.isAbsolute() && !uri.isOpaque()) { URI base=current(uri); while(!isRoot(base)) { parents.add(base); base=parent(base); } parents.add(base); } return Lists.newArrayList(parents); } }
URIHelper { public static List<URI> getParents(final URI uri) { checkNotNull(uri,"URI cannot be null"); Set<URI> parents = Sets.newLinkedHashSet(); parents.add(uri); if(uri.isAbsolute() && !uri.isOpaque()) { URI base=current(uri); while(!isRoot(base)) { parents.add(base); base=parent(base); } parents.add(base); } return Lists.newArrayList(parents); } private  URIHelper(); }
URIHelper { public static List<URI> getParents(final URI uri) { checkNotNull(uri,"URI cannot be null"); Set<URI> parents = Sets.newLinkedHashSet(); parents.add(uri); if(uri.isAbsolute() && !uri.isOpaque()) { URI base=current(uri); while(!isRoot(base)) { parents.add(base); base=parent(base); } parents.add(base); } return Lists.newArrayList(parents); } private  URIHelper(); static List<URI> getParents(final URI uri); }
URIHelper { public static List<URI> getParents(final URI uri) { checkNotNull(uri,"URI cannot be null"); Set<URI> parents = Sets.newLinkedHashSet(); parents.add(uri); if(uri.isAbsolute() && !uri.isOpaque()) { URI base=current(uri); while(!isRoot(base)) { parents.add(base); base=parent(base); } parents.add(base); } return Lists.newArrayList(parents); } private  URIHelper(); static List<URI> getParents(final URI uri);  }