@Test
  public void testValidateProps() {
    Properties props = new Properties();
    props.setProperty(MCAST_PORT, "0");
    props.setProperty(LOCATORS, "");
    Config config1 = new DistributionConfigImpl(props, false);
    MetricsService.Builder metricsSessionBuilder = mock(MetricsService.Builder.class);
    when(metricsSessionBuilder.build(any())).thenReturn(mock(MetricsService.class));
    InternalDistributedSystem sys =
        new InternalDistributedSystem.Builder(config1.toProperties(), metricsSessionBuilder)
            .build();
    try {

      props.put(MCAST_PORT, "1");
      Config config2 = new DistributionConfigImpl(props, false);

      assertThatThrownBy(() -> sys.validateSameProperties(config2.toProperties(), true))
          .isInstanceOf(IllegalStateException.class);

    } finally {
      sys.disconnect();
    }
  }
Create a <Code>DistributedSystem</code> with a non-default name.
geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/InternalDistributedSystemIntegrationTest.java