StandardOptionProvider implements OptionProvider { @Override public List<String> getOptions() { List<String> options = new ArrayList<>(); options.add(jvmType.getOptionValue()); options.add("-XX:+StartAttachListener"); options.add("-XX:+UseParallelGC"); Long maxHeapFreeRatioValue = null; if (initialHeap != null) options.add("-Xms" + initialHeap.getValue() + "m"); if (maxHeap != null) options.add("-Xmx" + maxHeap.getValue() + "m"); if (maxHeapFreeRatio != null) { maxHeapFreeRatioValue = maxHeapFreeRatio.getValue(); options.add("-XX:MaxHeapFreeRatio=" + maxHeapFreeRatioValue); } if (minHeapFreeRatio != null) { long min = minHeapFreeRatio.getValue(); if (maxHeapFreeRatioValue != null && min > maxHeapFreeRatioValue) min = maxHeapFreeRatioValue; options.add("-XX:MinHeapFreeRatio=" + min); } if (newRatio != null) options.add("-XX:NewRatio=" + newRatio.getValue()); if (survivorRatio != null) options.add("-XX:SurvivorRatio=" + survivorRatio.getValue()); return options; } StandardOptionProvider(long initialHeap, long maxHeap);  StandardOptionProvider(long initialHeap, long maxHeap, double coefficientOfVariance);  StandardOptionProvider(String javaOpts, double coefficientOfVariance); @Override List<String> getOptions();  }
@Test public void test() { assertThat(new StandardOptionProvider("-XX:MaxHeapFreeRatio=3", 0.0).getOptions()) .contains("-XX:MaxHeapFreeRatio=3"); }