MoreObjects { public static String toString(Class clazz) { if (clazz == null) { return "null"; } return clazz.getName() + "[" + toString(clazz.getClassLoader()) + "]"; }  static String toString(Class clazz); static String toString(ClassLoader classLoader);  }
@Test public void should_to_string_classloader() throws Exception { assertThat(MoreObjects.toString(classloader("Test"))).isEqualTo("Test"); assertThat(MoreObjects.toString(classloader("Test\ntest"))).isEqualTo("Test"); assertThat(MoreObjects.toString(classloader("Test\r\ntest"))).isEqualTo("Test"); }