TracerFormatRegistry { public static <T> void register(Format<T> format, RegistryExtractorInjector<T> extractor) { injectorsAndExtractors.put(format, extractor); }  @SuppressWarnings("unchecked") static RegistryExtractorInjector<T> getRegistry(Format<T> format); static void register(Format<T> format, RegistryExtractorInjector<T> extractor);  }
@Test public void testRegister() throws Exception { Registry registry = new Registry(); TracerFormatRegistry.register(io.opentracing.propagation.Format.Builtin.BINARY, registry); Registry registry1 = (Registry) TracerFormatRegistry .getRegistry(io.opentracing.propagation.Format.Builtin.BINARY); assertTrue(registry == registry1); BinaryFormater binaryFormater = new BinaryFormater(); TracerFormatRegistry.register(io.opentracing.propagation.Format.Builtin.BINARY, binaryFormater); }