@Test
  public void cannotMakeEncapsulatedFieldsAccessibleByDefault() {
    gfshRule.execute(startServer); // No JDK options

    String traversalResult = traverseEncapsulatedJdkObject
        .expectExitCode(1) // Because we did not open any JDK packages.
        .execute(gfshRule)
        .getOutputText();

    assertThat(traversalResult)
        .as("result of traversing %s", TraverseEncapsulatedJdkObject.OBJECT.getClass())
        .contains("Exception: java.lang.reflect.InaccessibleObjectException");
  }
Test several ways to make normally inaccessible JDK packages accessible on JDK 17.
geode-assembly/src/acceptanceTest/java/org/apache/geode/jdk/JdkEncapsulationTest.java