private void checkMembershipAPIUse(JavaClasses importedClasses) {
    ArchRule myRule = layeredArchitecture()
        .layer("internal")
        .definedBy(resideInAPackage("org.apache.geode.distributed.internal.membership.gms.."))
        .layer("api").definedBy("org.apache.geode.distributed.internal.membership.api")
        .whereLayer("internal").mayOnlyBeAccessedByLayers("api");

    myRule.check(importedClasses);
  }
This test ensures that various geode packages do not access membership internals.
It is broken into multiple tests in order to keep memory use low. Analyzing all
geode classes in a single test requires 1.5g of heap.<br>
This test class can be removed if and when we create an isolated Java module that does
not export internal membership classes.
geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/api/CoreOnlyUsesMembershipAPIArchUnitTest.java