### Question:
CaliperConfig { public InstrumentConfig getInstrumentConfig(String name) { checkNotNull(name); ImmutableMap<String, String> instrumentGroupMap = subgroupMap(properties, "instrument"); ImmutableMap<String, String> insrumentMap = subgroupMap(instrumentGroupMap, name); @Nullable String className = insrumentMap.get("class"); checkArgument(className != null, "no instrument configured named %s", name); return new InstrumentConfig.Builder() .className(className) .addAllOptions(subgroupMap(insrumentMap, "options")) .build(); } @VisibleForTesting  CaliperConfig(ImmutableMap<String, String> properties); ImmutableMap<String, String> properties(); VmConfig getDefaultVmConfig(); VmConfig getVmConfig(String name); ImmutableSet<String> getConfiguredInstruments(); InstrumentConfig getInstrumentConfig(String name); ImmutableSet<Class<? extends ResultProcessor>> getConfiguredResultProcessors(); ResultProcessorConfig getResultProcessorConfig(
      Class<? extends ResultProcessor> resultProcessorClass); @Override String toString();  }### Answer:
@Test public void getInstrumentConfig() throws Exception { CaliperConfig configuration = new CaliperConfig(ImmutableMap.of( "instrument.test.class", "test.ClassName", "instrument.test.options.a", "1", "instrument.test.options.b", "excited b b excited")); assertEquals( new InstrumentConfig.Builder() .className("test.ClassName") .addOption("a", "1") .addOption("b", "excited b b excited") .build(), configuration.getInstrumentConfig("test")); }
@Test public void getInstrumentConfig_notConfigured() throws Exception { CaliperConfig configuration = new CaliperConfig(ImmutableMap.of( "instrument.test.options.a", "1", "instrument.test.options.b", "excited b b excited")); try { configuration.getInstrumentConfig("test"); fail(); } catch (IllegalArgumentException expected) {} }