@Test public void testEqualsObject() { URI uri = URI.create("com:test"); Identifier id1 = new IdentifierImpl(uri); Identifier id2 = new IdentifierImpl("com:test2"); assertTrue(id1.equals(id1)); assertFalse(id1.equals(id2)); assertFalse(id1.equals(new Object())); Object foo = null; assertFalse(id1.equals(foo)); }
@Override public boolean equals(Object obj) { if (obj == this) { return true; } else if (obj == null || !(obj instanceof Identifier)) { return false; } else { return ObjUtil.equalsAllowNull(this.getUri(), ((Identifier)obj).getUri()); } }
IdentifierImpl implements Identifier { @Override public boolean equals(Object obj) { if (obj == this) { return true; } else if (obj == null || !(obj instanceof Identifier)) { return false; } else { return ObjUtil.equalsAllowNull(this.getUri(), ((Identifier)obj).getUri()); } } }
IdentifierImpl implements Identifier { @Override public boolean equals(Object obj) { if (obj == this) { return true; } else if (obj == null || !(obj instanceof Identifier)) { return false; } else { return ObjUtil.equalsAllowNull(this.getUri(), ((Identifier)obj).getUri()); } } IdentifierImpl(URI uriIn);  IdentifierImpl(String idIn);  IdentifierImpl(Identifier identifierBase, String id); }
IdentifierImpl implements Identifier { @Override public boolean equals(Object obj) { if (obj == this) { return true; } else if (obj == null || !(obj instanceof Identifier)) { return false; } else { return ObjUtil.equalsAllowNull(this.getUri(), ((Identifier)obj).getUri()); } } IdentifierImpl(URI uriIn);  IdentifierImpl(String idIn);  IdentifierImpl(Identifier identifierBase, String id); static Identifier gensym(String pfx); static Identifier gensym(); @Override URI getUri(); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String stringValue(); }
IdentifierImpl implements Identifier { @Override public boolean equals(Object obj) { if (obj == this) { return true; } else if (obj == null || !(obj instanceof Identifier)) { return false; } else { return ObjUtil.equalsAllowNull(this.getUri(), ((Identifier)obj).getUri()); } } IdentifierImpl(URI uriIn);  IdentifierImpl(String idIn);  IdentifierImpl(Identifier identifierBase, String id); static Identifier gensym(String pfx); static Identifier gensym(); @Override URI getUri(); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String stringValue();  }