src/main/java/io/github/glytching/junit/extension/system/SystemPropertyExtension.java
@Override
  public void beforeAll(ExtensionContext extensionContext) throws Exception {
    List<SystemProperty> systemProperties =
        getSystemProperties(extensionContext.getRequiredTestClass());
    if (!systemProperties.isEmpty()) {
      RestoreContext.Builder builder = RestoreContext.createBuilder();
      for (SystemProperty systemProperty : systemProperties) {
        builder.addPropertyName(systemProperty.name());
        if (System.getProperty(systemProperty.name()) != null) {
          builder.addRestoreProperty(
              systemProperty.name(), System.getProperty(systemProperty.name()));
        }

        set(systemProperty);
      }
      writeRestoreContext(extensionContext, builder.build());
    }
  }
@Override
  public void beforeAll(ExtensionContext extensionContext) throws Exception {
    List<SystemProperty> systemProperties =
        getSystemProperties(extensionContext.getRequiredTestClass());
    if (!systemProperties.isEmpty()) {
      RestoreContext.Builder builder = RestoreContext.createBuilder();
      for (SystemProperty systemProperty : systemProperties) {
        builder.addPropertyName(systemProperty.name());
        if (System.getProperty(systemProperty.name()) != null) {
          builder.addRestoreProperty(
              systemProperty.name(), System.getProperty(systemProperty.name()));
        }

        set(systemProperty);
      }
      writeRestoreContext(extensionContext, builder.build());
    }
  }
If the current test class has a system property annotation(s) then create a {@link
RestoreContext} representing the annotation(s). This causes the requested system properties to
be set and retains a copy of pre-set values for reinstatement after test execution.

@param extensionContext the <em>context</em> in which the current test or container is being
executed
@throws Exception