* {@link TestCase} and has methods that starts with test which are not
* annotated.
*/
@SuppressWarnings("unchecked")
private void validateTestMethods(Class<? extends Annotation> annotation, boolean isStatic) {
TestClass testClass = (TestClass) Whitebox.getInternalState(this, "fTestClass", MethodValidator.class);
Class<?> classUnderTest = (Class<?>) Whitebox.getInternalState(testClass, "fClass");
final List<Method> methods;
if (TestCase.class.equals(classUnderTest.getSuperclass()) && !isStatic) {
methods = getTestMethodsWithNoAnnotation(classUnderTest);
} else {
methods = testClass.getAnnotatedMethods(annotation);
}
List<Throwable> fErrors = (List<Throwable>) Whitebox.getInternalState(this, "fErrors", MethodValidator.class);
for (Method each : methods) {
if (Modifier.isStatic(each.getModifiers()) != isStatic) {