CounterSet extends CounterFactory { public Counter<?, ?> getExistingCounter(CounterName name) { return counters.get(name); }  Counter<?, ?> getExistingCounter(CounterName name); @Deprecated Counter<?, ?> getExistingCounter(String name); long size(); List<UpdateT> extractUpdates(
      boolean delta, CounterUpdateExtractor<UpdateT> extractors); List<UpdateT> extractModifiedDeltaUpdates(
      CounterUpdateExtractor<UpdateT> extractors); @Override String toString();  }
@Test public void testNonMatchingCounterName() { CounterName cn1 = CounterName.named("myCounter1, origin="); CounterName cn2 = CounterName.named("myCounter1").withOrigin(", origin="); assertThat(cn1.getFlatName(), equalTo(cn1.getFlatName())); Counter<?, ?> c1 = counterSet.longSum(cn1); assertThat(c1, not(equalTo(counterSet.getExistingCounter(cn2)))); }
@Test public void testMatchingByCounterName() { CounterName cn1 = CounterName.named("myCounter1"); CounterName cn2 = CounterName.named("myCounter1"); Counter<?, ?> c1 = counterSet.longSum(cn1); assertThat(c1, equalTo(counterSet.getExistingCounter(cn2))); }