### Question:
CompositeRegistry implements Registry { @Override public Meter get(Id id) { rlock.lock(); try { for (Registry r : registries) { Meter m = r.get(id); if (m != null) { if (m instanceof Counter) { return counter(id); } else if (m instanceof Timer) { return timer(id); } else if (m instanceof DistributionSummary) { return distributionSummary(id); } else if (m instanceof Gauge) { return gauge(id); } else { return null; } } } return null; } finally { rlock.unlock(); } } CompositeRegistry(Clock clock); void add(Registry registry); void remove(Registry registry); void removeAll(); @Override Clock clock(); @Override Id createId(String name); @Override Id createId(String name, Iterable<Tag> tags); @Override void register(Meter meter); @Override ConcurrentMap<Id, Object> state(); @Override Counter counter(Id id); @Override DistributionSummary distributionSummary(Id id); @Override Timer timer(Id id); @Override Gauge gauge(Id id); @Override Gauge maxGauge(Id id); @Override Meter get(Id id); @Override Iterator<Meter> iterator();  }### Answer:
@Test public void testGet() { Registry r = newRegistry(5, true); Counter c = r.counter(r.createId("foo")); c.increment(42); Meter m = r.get(c.id()); Assertions.assertEquals(c.measure().iterator().next(), m.measure().iterator().next()); }