outer:
for (Class cls : allClasses) {
try {
if (null != cls) {
for (Method m : cls.getMethods()) {
IAnnotation a = annotationFinder.findAnnotation(m,
org.testng.annotations.IObjectFactoryAnnotation.class);
if (null != a) {
if (!ITestObjectFactory.class.isAssignableFrom(m.getReturnType())) {
throw new TestNGException("Return type of " + m + " is not IObjectFactory");
}