package org.junit.jupiter.engine.discovery.predicates;
import static org.apiguardian.api.API.Status.INTERNAL;
import static org.junit.platform.commons.util.ReflectionUtils.isAbstract;
import static org.junit.platform.commons.util.ReflectionUtils.isInnerClass;
import static org.junit.platform.commons.util.ReflectionUtils.isPrivate;
import java.util.function.Predicate;
import org.apiguardian.api.API;
@API(status = INTERNAL, since = "5.0")
public class IsPotentialTestContainer implements Predicate<Class<?>> {
@Override
public boolean test(Class<?> candidate) {
if (isPrivate(candidate)) {
return false;
}
if (isAbstract(candidate)) {
return false;
}
if (candidate.isLocalClass()) {
return false;
}
if (candidate.isAnonymousClass()) {
return false;
}
return !isInnerClass(candidate);
}
}