@Test
  public void testGeodeOnClasspathIsFirst() {
    String currentClasspath = System.getProperty("java.class.path");
    final Path customGeodeJarPATH =
        Paths.get("/custom", "geode-core-" + GemFireVersion.getGemFireVersion() + ".jar");
    final Path prependJar1 = Paths.get("/prepend", "pre1.jar");
    final Path prependJar2 = Paths.get("/prepend", "pre2.jar");
    final Path otherJar1 = Paths.get("/other", "one.jar");
    final Path otherJar2 = Paths.get("/other", "two.jar");
    final String customGeodeCore = FileSystems.getDefault().getPath(customGeodeJarPATH.toString())
        .toAbsolutePath().toString();

    currentClasspath = prependToClasspath(customGeodeCore, currentClasspath);
    currentClasspath =
        prependToClasspath(prependJar2.toString(), currentClasspath);
    prependToClasspath(prependJar1.toString(), currentClasspath);

    String[] otherJars = new String[] {
        FileSystems.getDefault().getPath(otherJar1.toString()).toAbsolutePath().toString(),
        FileSystems.getDefault().getPath(otherJar2.toString()).toAbsolutePath().toString()};

    String gemfireClasspath = StartMemberUtils.toClasspath(true, otherJars);
    assertThat(gemfireClasspath).startsWith(customGeodeCore);

    gemfireClasspath = StartMemberUtils.toClasspath(false, otherJars);
    assertThat(gemfireClasspath).startsWith(customGeodeCore);
  }
Verify that the classpath for Geode always has the geode-core jar first in the list of paths.
On entry to the test there may (depending test platform) be a version of geode-core-*.jar on
the system classpath, but at an unknown position in the list. To make the test deterministic, a
dummy geode-core-*.jar path is inserted in the system classpath at a known, but not the first,
position.
geode-gfsh/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/StartMemberUtilsTest.java