ReflectionUtils { public static Package getCallerPackage() throws IllegalStateException { return getCallerClass().getPackage(); }  @Nonnull static String getCallerClassName(); @Nonnull static Class<?> getCallerClass(); static Package getCallerPackage(); static void assertArrayIndex(Object array, int index); static void assertArrayType(Object array); static void assertFieldMatchType(Object object, String fieldName, Class<?> expectedType); @Nonnull static List<T> toList(Object array); @Nonnull static Map<String, Object> readFieldsAsMap(Object object); static final String SUN_REFLECT_REFLECTION_CLASS_NAME; }
@Test public void testGetCallerPackage() { Class<?> expectedClass = ReflectionUtilsTest.class; Package expectedPackage = expectedClass.getPackage(); Assert.assertEquals(expectedPackage, ReflectionUtils.getCallerPackage()); }