### Question:
VolatileSequencer implements Sequencer, VolatileSequencerMBean { public String[] getCounterNames () { Object[] o = map.keySet().toArray(); String[] s = new String [o.length]; System.arraycopy (o, 0, s, 0, o.length); return s; } VolatileSequencer(); synchronized int get(String counterName, int add); int get(String counterName); synchronized int set(String counterName, int newValue); String[] getCounterNames();  }### Answer:
@Test public void testGetCounterNames() throws Throwable { VolatileSequencer volatileSequencer = new VolatileSequencer(); volatileSequencer.get("testVolatileSequencerCounterName", 100); String[] result = volatileSequencer.getCounterNames(); assertEquals(1, result.length, "result.length"); assertEquals("testVolatileSequencerCounterName", result[0], "result[0]"); }
@Test public void testGetCounterNames1() throws Throwable { VolatileSequencer volatileSequencer = new VolatileSequencer(); String[] result = volatileSequencer.getCounterNames(); assertEquals(0, result.length, "result.length"); }