### Question:
SimpleMetricClassManager implements MetricClassManager { @Override public Metric instantiateMetric(String metricName) throws IllegalArgumentException, InstantiationException { final Class<? extends Metric> klazz = findMetricClass(metricName); return instantiateMetricClass(klazz); } SimpleMetricClassManager(Collection<String> metricClasses); @Override Collection<String> getMetrics(); @Override Metric instantiateMetric(String metricName);  }### Answer:
@Test public void canInstantiateSimpleMetric() throws Exception { Metric m = manager.instantiateMetric("io.sease.rre.core.domain.metrics.impl.PrecisionAtOne"); assertNotNull(m); assertTrue(m instanceof io.sease.rre.core.domain.metrics.impl.PrecisionAtOne); }
@Test(expected = IllegalArgumentException.class) public void throwsExceptionForUndefinedMetric() throws Exception { manager.instantiateMetric("blah.blah.NoMetric"); }
@Test(expected = IllegalArgumentException.class) public void throwsExceptionForNonExistentMetric() throws Exception { manager.instantiateMetric("non.existent.DummyMetric"); }
@Test(expected = InstantiationException.class) public void throwsExceptionForMetricRequiringConfig() throws Exception { manager.instantiateMetric("io.sease.rre.core.domain.metrics.impl.PrecisionAtK"); }