diff --git a/archunit-integration-test/src/test/java/com/tngtech/archunit/PublicAPIRules.java b/archunit-integration-test/src/test/java/com/tngtech/archunit/PublicAPIRules.java index cf49407447..277f3ff707 100644 --- a/archunit-integration-test/src/test/java/com/tngtech/archunit/PublicAPIRules.java +++ b/archunit-integration-test/src/test/java/com/tngtech/archunit/PublicAPIRules.java @@ -29,6 +29,7 @@ import static com.tngtech.archunit.base.DescribedPredicate.anyElementThat; import static com.tngtech.archunit.base.DescribedPredicate.doNot; import static com.tngtech.archunit.base.DescribedPredicate.not; +import static com.tngtech.archunit.core.domain.JavaClass.Predicates.ANONYMOUS_CLASSES; import static com.tngtech.archunit.core.domain.JavaClass.Predicates.assignableTo; import static com.tngtech.archunit.core.domain.JavaClass.Predicates.equivalentTo; import static com.tngtech.archunit.core.domain.JavaClass.Predicates.resideInAPackage; @@ -188,15 +189,6 @@ private boolean enumMethod(JavaMethod methodToCheck, String name, Class... pa }; } - private static DescribedPredicate anonymousClass() { - return new DescribedPredicate("anonymous class") { - @Override - public boolean apply(JavaClass input) { - return input.isAnonymousClass(); - } - }; - } - private static DescribedPredicate declaredInClassIn(String packageIdentifier) { return declaredIn(resideInAPackage(packageIdentifier).as("class in '%s'", packageIdentifier)); } @@ -286,7 +278,7 @@ private boolean isPublicAPISuperMethod(JavaMethod candidate, JavaMethod methodTo private static DescribedPredicate relevantArchUnitMembers() { return not(inheritedFromObjectOrEnum()) .and(not(declaredIn(assignableTo(Annotation.class)))) - .and(not(declaredIn(anonymousClass()))) + .and(not(declaredIn(ANONYMOUS_CLASSES))) .and(not(declaredIn(internal()))) .and(not(declaredInClassIn(THIRDPARTY_PACKAGE_IDENTIFIER))) .as("relevant members");