EventUtils { public static String getCallingClassName() { StackTraceElement[] stes = Thread.currentThread().getStackTrace(); for (int i = 2; i < stes.length; i++) { if (!stes[i].getClassName().startsWith(Event.class.getPackage().getName()) || stes[i].getClassName().startsWith(Event.class.getPackage().getName() + ".Test")) { return stes[i].getClassName(); } } throw new RuntimeException("Could not determine class that provided event"); }  static String prettifyNs(long ns); static String getCallingClassName();  }
@Test public void testCallingClassName() { assertEquals(TestEventUtils.class.getName(), EventUtils.getCallingClassName()); }