### Question:
Ref implements Comparable<Ref> { @Override public boolean equals(Object o) { if (!(o instanceof Ref)) { return false; } Ref r = (Ref) o; return name.equals(r.getName()) && objectId.equals(r.getObjectId()); } Ref(final String name, final ObjectId oid); String getName(); String localName(); static String localName(final String ref); String namespace(); static String namespace(final String ref); ObjectId getObjectId(); @Override boolean equals(Object o); @Override int hashCode(); @Override int compareTo(Ref o); @Override String toString(); static String append(String namespace, String child); static String child(String namespace, String ref); static final String MASTER; static final String HEAD; static final String STAGE_HEAD; static final String WORK_HEAD; static final String MERGE_HEAD; static final String CHERRY_PICK_HEAD; static final String ORIG_HEAD; static final String REFS_PREFIX; static final String REMOTES_PREFIX; static final String TAGS_PREFIX; static final String HEADS_PREFIX; static final String TRANSACTIONS_PREFIX; static final String ORIGIN; }### Answer:
@Test public void testEquals() throws Exception { insertAndAdd(points1); RevCommit oid = geogig.command(CommitOp.class).call(); Ref testRef = new Ref(Ref.REFS_PREFIX + "commit1", oid.getId()); insertAndAdd(lines1); RevCommit oid2 = geogig.command(CommitOp.class).call(); Ref testRef2 = new Ref(Ref.REFS_PREFIX + "commit2", oid2.getId()); assertFalse(testRef.equals(testRef2)); testRef2 = new Ref(Ref.REFS_PREFIX + "commit1", oid.getTreeId()); assertFalse(testRef.equals(testRef2)); assertFalse(testRef.equals("not a ref")); assertTrue(testRef.equals(testRef)); }