### Question:
MeterPool { public Meter getMeter(String scope) { if (scope == null) { throw new IllegalArgumentException("scope cannot be null"); } Meter meter = meters.get(scope); if (meter == null) { meter = Metrics.newMeter(clazz, name, scope, name, TimeUnit.SECONDS); Meter existing = meters.putIfAbsent(scope, meter); if (existing != null) { meter = existing; } } return meter; } MeterPool(Class<?> clazz, String name); Meter getMeter(String scope);  }### Answer:
@Test(expected = IllegalArgumentException.class) public void getMeterNullScope() { new MeterPool(Object.class, "name").getMeter(null); }
@Test public void getMeterSameScope() { MeterPool pool = new MeterPool(Object.class, "name"); Meter meter1 = pool.getMeter("scope"); Meter meter2 = pool.getMeter("scope"); assertSame(meter1, meter2); }
@Test public void getMeterDifferentScope() { MeterPool pool = new MeterPool(Object.class, "name"); Meter meter1 = pool.getMeter("scope1"); Meter meter2 = pool.getMeter("scope2"); assertThat(meter1, is(not(equalTo(meter2)))); }