### Question:
AllocationInstrument extends Instrument { @Override ImmutableSet<String> getExtraCommandLineArgs() { String agentJar = options.get(ALLOCATION_AGENT_JAR_OPTION); if (Strings.isNullOrEmpty(agentJar)) { try { Optional<File> instrumentJar = findAllocationInstrumentJarOnClasspath(); if (instrumentJar.isPresent()) { agentJar = instrumentJar.get().getAbsolutePath(); } } catch (IOException e) { logger.log(SEVERE, "An exception occurred trying to locate the allocation agent jar on the classpath", e); } } if (Strings.isNullOrEmpty(agentJar) || !new File(agentJar).exists()) { throw new IllegalStateException("Can't find required allocationinstrumenter agent jar"); } return new ImmutableSet.Builder<String>() .addAll(super.getExtraCommandLineArgs()) .add("-javaagent:" + agentJar) .add("-Xbootclasspath/a:" + agentJar) .build(); }  @Override boolean isBenchmarkMethod(Method method); @Override Instrumentation createInstrumentation(Method benchmarkMethod); @Override ImmutableSet<String> instrumentOptions();  }### Answer:
@Test public void testGetExtraCommandLineArgs() throws Exception { AllocationInstrument instrument = new AllocationInstrument(); File fakeJar = File.createTempFile("fake", "jar"); fakeJar.deleteOnExit(); instrument.setOptions(ImmutableMap.of("allocationAgentJar", fakeJar.getAbsolutePath())); ImmutableSet<String> expected = new ImmutableSet.Builder<String>() .addAll(Instrument.JVM_ARGS) .add("-javaagent:" + fakeJar.getAbsolutePath()) .add("-Xbootclasspath/a:" + fakeJar.getAbsolutePath()) .add("-Dsun.reflect.inflationThreshold=0") .build(); assertEquals(expected, instrument.getExtraCommandLineArgs()); fakeJar.delete(); }