### Question:
ServerContextImpl implements ServerContext { @Override public synchronized void registerGauge(String key, Gauge gauge) { checkIsRunning(); ParamChecker.notEmpty(key, "key"); ParamChecker.notNull(gauge, "gauge"); key = getFullMetricKey(key, MetricType.GAUGE); LOG.debug("'{}' - registerGauge({})", name, key); ProxyGauge proxyGauge = findMetric(MetricType.GAUGE, key); if (proxyGauge == null) { proxyGauge = new ProxyGauge(gauge); metricRegistry.register(key, proxyGauge); } else { proxyGauge.setGauge(gauge); } } ServerContextImpl(String name, String prefix, int asyncThreads,
      int asyncMaxQueued, int schedulerThreads); @SuppressWarnings("unchecked") synchronized void start(); synchronized void stop(); synchronized MetricRegistry getMetricRegistry(); @Override Scheduled scheduleExecution(Callable<Void> callable,
      long firstExecutionDelay, long executionInterval, TimeUnit timeUnit); @Override boolean asyncExecution(Callable<Void> callable); @Override boolean asyncExecution(Callable<Void> callable, long executionDelay,
      TimeUnit timeUnit); @Override String createMetricKey(String component, String key); @Override synchronized void registerGauge(String key, Gauge gauge); @Override synchronized Timer registerTimer(String key); @Override synchronized Meter registerMeter(String key);  }### Answer:
@Test public void testRegisterGauge() throws Exception { ServerContextImpl impl = new ServerContextImpl("llama", "Server Context", 50, 50, 2); impl.start(); String key = impl.createMetricKey("Test", "ServerContext"); Gauge guage = new Gauge() { @Override public Object getValue() { return this; } }; impl.registerGauge(key, guage); }