void () { assertOrderedEquals(mergeJvmArgs(List.of("-X:foo"), emptyList()), List.of("-X:foo")); assertOrderedEquals(mergeJvmArgs(emptyList(), List.of("-X:foo")), List.of("-X:foo")); assertOrderedEquals(mergeJvmArgs(List.of("-Dp=val"), List.of("-Dp=newVal")), List.of("-Dp=newVal")); assertOrderedEquals( mergeJvmArgs(List.of("-X:foo"), List.of("-Dp=v")), Arrays.asList("-X:foo", "-Dp=v")); assertOrderedEquals( mergeJvmArgs(Arrays.asList("-X:foo", "-Foo", "bar=001", "-Foo", "baz=002"), Arrays.asList("-Dp=v", "-Foo", "bar=003", "-Foo", "baz=002")), Arrays.asList("-X:foo", "-Foo", "bar=003", "-Foo", "baz=002", "-Dp=v")); List<String> jvmArgs = mergeBuildJvmArguments(Arrays.asList("-Xmx256", "--add-opens", "java.base/java.util=ALL-UNNAMED"), Arrays.asList("-Xmx512", "--add-opens", "java.base/java.lang=ALL-UNNAMED")); assertDoesntContain(jvmArgs, "-Xmx256", "--add-opens", "java.base/java.util=ALL-UNNAMED", "java.base/java.lang=ALL-UNNAMED"); assertContainsElements(jvmArgs, "-Xmx512"); }