DOMNotificationRouter implements AutoCloseable, DOMNotificationPublishService,
        DOMNotificationService, DOMNotificationSubscriptionListenerRegistry { @Override public ListenableFuture<? extends Object> offerNotification(final DOMNotification notification) { final Collection<AbstractListenerRegistration<? extends DOMNotificationListener>> subscribers = listeners.get(notification.getType()); if (subscribers.isEmpty()) { return NO_LISTENERS; } return publish(notification, subscribers); } @VisibleForTesting  DOMNotificationRouter(int maxQueueCapacity); static DOMNotificationRouter create(int maxQueueCapacity); @Override synchronized ListenerRegistration<T> registerNotificationListener(
            final T listener, final Collection<Absolute> types); @Override ListenerRegistration<L> registerSubscriptionListener(
            final L listener); @Override ListenableFuture<? extends Object> putNotification(final DOMNotification notification); @Override ListenableFuture<? extends Object> offerNotification(final DOMNotification notification); @Override ListenableFuture<? extends Object> offerNotification(final DOMNotification notification, final long timeout,
            final TimeUnit unit); @Override void close();  }
@Test public void offerNotification() throws Exception { final DOMNotificationRouter domNotificationRouter = DOMNotificationRouter.create(1024); final DOMNotification domNotification = mock(DOMNotification.class); doReturn(Absolute.of(TestModel.TEST_QNAME)).when(domNotification).getType(); doReturn(TEST_CHILD).when(domNotification).getBody(); assertNotNull(domNotificationRouter.putNotification(domNotification)); assertNotNull(domNotificationRouter.offerNotification(domNotification)); assertNotNull(domNotificationRouter.offerNotification(domNotification, 1, TimeUnit.SECONDS)); }