OntologyTerm { public static OntologyTerm createFromURI(String uri) { return uri.contains("/") ? create(splitAtLastSlash(uri)[1], "", splitAtLastSlash(uri)[0]) : create(uri); }  abstract String accession(); abstract String name(); abstract String source(); abstract int depth(); static OntologyTerm create(String accession); static OntologyTerm create(String accession, String name); static OntologyTerm create(String accession, String name, String source); static OntologyTerm create(String accession, String name, String source, int depth); static OntologyTerm createFromURI(String uri); String uri(); static JsonElement jsonForHeaders(Set<OntologyTerm> ontologyTerms);  }
@Test public void createFromURI() { assertThat(OntologyTerm.createFromURI(UBERON_0002107_URL).accession(), is(UBERON_0002107_TERM.accession())); assertThat(OntologyTerm.createFromURI(UBERON_0002107_URL).source(), is(UBERON_0002107_TERM.source())); }