TraceRegistry { public static Trace get(int id) { return registry.get(id); }  static TraceRegistryAdaptor getTraceRegistryAdaptor(); static void bind(TraceRegistryAdaptor registry); static void unbind(); static Trace get(int id);  }
@Test public void testGetTrace() { Trace trace = mock(Trace.class); when(mockTraceRegistryAdaptor.get(0)).thenReturn(trace); int id = mockTraceRegistryAdaptor.add(trace); assertThat(id, is(0)); assertThat(TraceRegistry.get(id), sameInstance(trace)); }