PhenotypeTerm implements Comparable<PhenotypeTerm> { @JsonCreator public static PhenotypeTerm of(String id, String label) { return new PhenotypeTerm(id, label, Status.PRESENT); } private  PhenotypeTerm(String id, String label, Status status); @JsonProperty String getId(); @JsonProperty String getLabel(); @JsonIgnore boolean isPresent(); @JsonIgnore boolean notPresent(); @Override boolean equals(Object o); @Override int hashCode(); @Override int compareTo(PhenotypeTerm o); @Override String toString(); @JsonCreator static PhenotypeTerm of(String id, String label); static PhenotypeTerm notOf(String id, String label);  }
@Test void wontAcceptNullId() { assertThrows(NullPointerException.class, () -> PhenotypeTerm.of(null, "label")); }
@Test public void testEqualsOther() { PhenotypeTerm other = PhenotypeTerm.of(id, label); assertThat(instance, equalTo(other)); }
@Test public void testNotEqualsOther() { PhenotypeTerm other = PhenotypeTerm.of("other", label); assertThat(instance, not(equalTo(other))); }
@Test public void testOf() { assertThat(PhenotypeTerm.of("id", "label"), equalTo(PhenotypeTerm.of("id", "label"))); assertThat(PhenotypeTerm.of("id", "label").isPresent(), is(true)); assertThat(PhenotypeTerm.of("id", "label").notPresent(), is(false)); assertThat(PhenotypeTerm.of("otherId", "otherLabel"), not(equalTo(PhenotypeTerm.of("id", "label")))); }