@Test
  public void restrictUseOfDeprecatedAdminInetAddressUtils() {
    Map<String, CompiledClass> classes = classProvider.getClasses();
    Set<String> exclusions = new HashSet<>(Arrays.asList(
        "org/apache/geode/admin/internal/AdminDistributedSystemImpl",
        "org/apache/geode/admin/internal/ConfigurationParameterImpl",
        "org/apache/geode/admin/internal/DistributedSystemConfigImpl",
        "org/apache/geode/admin/internal/DistributionLocatorConfigImpl",
        "org/apache/geode/admin/internal/ManagedEntityConfigImpl",
        "org/apache/geode/admin/internal/SystemMemberImpl",
        "org/apache/geode/admin/jmx/internal/AgentConfigImpl",
        "org/apache/geode/admin/jmx/internal/MX4JServerSocketFactory"));

    assertExcludedClassesExist(classes, exclusions);

    StringWriter writer = new StringWriter();

    final List<String> classNames = Arrays.asList(
        "org/apache/geode/admin/internal/InetAddressUtils",
        "org/apache/geode/admin/internal/InetAddressUtilsWithLogging");

    for (String className : classNames) {
      classes.remove(className);
    }

    assertExclusionsUseClasses(classes, exclusions, classNames);
    searchForClassReferences(classes, exclusions, classNames, writer);

    // use an assertion on the StringWriter rather than the failure count so folks can
    // tell what failed
    String actual = writer.toString();
    String expected = "";
    assertThat(actual)
        .withFailMessage(
            "Unexpected use of restricted InetAddress utility methods need to be sanctioned by this test.\n"
                + "Use of these methods can cause off-platform errors when using a service gateway.\n"
                + actual)
        .isEqualTo(expected);
  }
The deprecated Admin service holds two InetAddress utiltity classes that
should not be used outside of the admin package.
geode-core/src/integrationTest/java/org/apache/geode/codeAnalysis/RestrictUseOfInetAddressJUnitTest.java