### Question:
Ref implements Comparable<Ref> { public @Override String toString() { return String.format("[%s -> %s]", name, objectId); } Ref(final @NonNull String name, final @NonNull ObjectId oid); String getName(); String localName(); static String localName(final String ref); String namespace(); static String namespace(final String ref); static Optional<String> remoteName(final String ref); static String parentPath(final String ref); static String simpleName(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); Ref peel(); static boolean isChild(@NonNull String parent, @NonNull String ref); static String stripCommonPrefix(final @NonNull 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 testToString() throws Exception { Ref testRef = new Ref(Ref.REFS_PREFIX + "commit1", oid); assertEquals("[" + testRef.getName() + " -> " + testRef.getObjectId().toString() + "]", testRef.toString()); }