It would be nice if `getDeclaringClass()` returns a `TestClass` object, which is JUnit's wrapper for Class objects. Then you can add an `isPublic()` method to `TestClass` and avoid the duplicate `Modifier.isPublic(aClass.getModifiers())`