@Test public void findRootEnclosingClassForInternalClass() throws Exception { assertThat(Util.findRootEnclosingClass(InternalClass.class)).isSameAs(UtilTest.class); }
@Nonnull public static Class findRootEnclosingClass(@Nonnull final Class clazz) { Class curr = clazz; while (true) { Class declaringClass = curr.getEnclosingClass(); if (declaringClass != null) { curr = declaringClass; } else { return curr; } } }
Util { @Nonnull public static Class findRootEnclosingClass(@Nonnull final Class clazz) { Class curr = clazz; while (true) { Class declaringClass = curr.getEnclosingClass(); if (declaringClass != null) { curr = declaringClass; } else { return curr; } } } }
Util { @Nonnull public static Class findRootEnclosingClass(@Nonnull final Class clazz) { Class curr = clazz; while (true) { Class declaringClass = curr.getEnclosingClass(); if (declaringClass != null) { curr = declaringClass; } else { return curr; } } }  }
Util { @Nonnull public static Class findRootEnclosingClass(@Nonnull final Class clazz) { Class curr = clazz; while (true) { Class declaringClass = curr.getEnclosingClass(); if (declaringClass != null) { curr = declaringClass; } else { return curr; } } }  @Nonnull static String stripCrLf(@Nonnull final String text); @Nonnull static Class findRootEnclosingClass(@Nonnull final Class clazz); }
Util { @Nonnull public static Class findRootEnclosingClass(@Nonnull final Class clazz) { Class curr = clazz; while (true) { Class declaringClass = curr.getEnclosingClass(); if (declaringClass != null) { curr = declaringClass; } else { return curr; } } }  @Nonnull static String stripCrLf(@Nonnull final String text); @Nonnull static Class findRootEnclosingClass(@Nonnull final Class clazz);  }