code:     public void testBeforeTest() throws IOException {
          long clusterSeed = randomLong();
          int minNumDataNodes = randomIntBetween(0, 3);
          int maxNumDataNodes = randomIntBetween(minNumDataNodes, 4);
          final String clusterName = clusterName("shared", Integer.toString(CHILD_JVM_ID), clusterSeed);
          String clusterName1 = clusterName("shared", Integer.toString(CHILD_JVM_ID), clusterSeed);
          while (clusterName.equals(clusterName1)) {
              clusterName1 = clusterName("shared", Integer.toString(CHILD_JVM_ID), clusterSeed);   // spin until the time changes
          }
          SettingsSource settingsSource = SettingsSource.EMPTY;
          int numClientNodes = randomIntBetween(0, 2);
          boolean enableRandomBenchNodes = randomBoolean();
          boolean enableHttpPipelining = randomBoolean();
          int jvmOrdinal = randomIntBetween(0, 10);
          String nodePrefix = "foobar";
  
          InternalTestCluster cluster0 = new InternalTestCluster(clusterSeed, minNumDataNodes, maxNumDataNodes, clusterName, settingsSource, numClientNodes, enableHttpPipelining, jvmOrdinal, nodePrefix);
          InternalTestCluster cluster1 = new InternalTestCluster(clusterSeed, minNumDataNodes, maxNumDataNodes, clusterName1, settingsSource, numClientNodes, enableHttpPipelining, jvmOrdinal, nodePrefix);
  
          assertClusters(cluster0, cluster1, false);
          long seed = randomLong();
          try {
              {
                  Random random = new Random(seed);
                  cluster0.beforeTest(random, random.nextDouble());
              }
              {
                  Random random = new Random(seed);
                  cluster1.beforeTest(random, random.nextDouble());
              }
              assertArrayEquals(cluster0.getNodeNames(), cluster1.getNodeNames());
              Iterator<Client> iterator1 = cluster1.iterator();
              for (Client client : cluster0) {
                  assertTrue(iterator1.hasNext());
                  Client other = iterator1.next();
                  assertSettings(client.settings(), other.settings(), false);
              }
              assertArrayEquals(cluster0.getNodeNames(), cluster1.getNodeNames());
              cluster0.afterTest();
              cluster1.afterTest();
          } finally {
  
              IOUtils.close(cluster0, cluster1);
          }
      }
  