PerformanceMonitorFactory { public Set<String> getPerformanceMonitorNames() { return performanceMonitorMap.keySet(); } PerformanceMonitorFactory(); synchronized PerformanceMonitor createPerformanceMonitor(String name); PerformanceMonitor findPerformanceMonitor(String name); Set<String> getPerformanceMonitorNames();  }
@Test public void testGetPerformanceMonitorNames() { Set<String> testSet = new HashSet<String>(); testSet.add("one"); testSet.add("two"); testSet.add("three"); testSet.add("four"); factory.createPerformanceMonitor("one"); factory.createPerformanceMonitor("two"); factory.createPerformanceMonitor("three"); factory.createPerformanceMonitor("four"); Set<String> monitorNames = factory.getPerformanceMonitorNames(); assertEquals(testSet, monitorNames); }