### Question:
VolatileSequencer implements Sequencer, VolatileSequencerMBean { synchronized public int set (String counterName, int newValue) { int oldValue = 0; Integer I = (Integer) map.get (counterName); if (I != null) oldValue = I; map.put (counterName, newValue); return oldValue; } 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 testSet() throws Throwable { VolatileSequencer volatileSequencer = new VolatileSequencer(); int add = volatileSequencer.get("", 100); int result = volatileSequencer.set("", add); assertEquals(add, result, "result"); }
@Test public void testSet2() throws Throwable { VolatileSequencer volatileSequencer = new VolatileSequencer(); int result = volatileSequencer.set("testVolatileSequencerCounterName", 100); assertEquals(0, result, "result"); }