Debug { public static String objectId(Object o) { if (o == null) { return null; } return abbreviatedName(o.getClass()) + "@" + toMemorableString(System.identityHashCode(o)); }  static String toMemorableString(long num); static String objectId(Object o); static String abbreviatedName(Class<?> c); static String shortName(Class<?> c);  }
@Test public void testObjectId() { Map<String, String> m = new HashMap<String, String>(); assertEquals(Debug.abbreviatedName(m.getClass()) + "@" + Debug.toMemorableString(System.identityHashCode(m)), Debug.objectId(m)); }