public static String describe(Object o) {
    try {
      if (o.getClass().getMethod("toString").getDeclaringClass() != Object.class) {
        String str = o.toString();
        if (str != null) {
          return str;
        }
      }
    } catch (Exception e) {
      // fallback
    }

    return o.getClass().getName();
  }
@Test
  public void describe() {
    assertThat(ScannerUtils.describe(new Object())).isEqualTo("java.lang.Object");
    assertThat(ScannerUtils.describe(new TestClass())).isEqualTo("overridden");
  }