ListenerRegistries { public static <I, F> ListenerRegistry.RegisteredListener<I, F> newRegisteredListener(I id, F listener) { return new SimpleRegisteredListener<>(id, listener); }  static ListenerRegistry<I, F> copyOf(ListenerRegistry<I, F> registry,
                                                       Function<Map<I, ListenerRegistry.RegisteredListener<I, F>>, ListenerRegistry<I, F>> registryFactory); static ListenerRegistry.RegisteredListener<I, F> newImmutableRegisteredListener(I identifier, F listener,
                                                                                                  ImmutableListenerProvider<I, F> immutableListenerProvider); static ListenerRegistry.RegisteredListener<I, F> newImmutableRegisteredListener(ListenerRegistry.RegisteredListener<I, F> listener,
                                                                                                  ImmutableListenerProvider<I, F> immutableListenerProvider); static ListenerRegistry.RegisteredListener<I, F> newRegisteredListener(I id, F listener); static ListenerRegistry<I, F> newImmutableRegistry(ListenerRegistry<I, F> registry);  }
@Test public void newRegisteredListener() { ListenerRegistry.RegisteredListener<String, Integer> test = ListenerRegistries.newRegisteredListener("test", 2); assertEquals("test", test.getIdentifier()); assertEquals(Integer.valueOf(2), test.getListener()); }