KogitoCommandRegistry implements Registry<C> { @Override public C pop() { Optional<C> optional = Optional.ofNullable(wrapped.pop()); if (optional.isPresent()) { notifyRegistryChange(); } return optional.orElse(null); } KogitoCommandRegistry();   KogitoCommandRegistry(Supplier<Boolean> envelopeEnabledSupplier, Supplier<KogitoJSCommandRegistry<C>> kogitoJSCommandRegistrySupplier); @Override void register(C item); @Override C peek(); @Override C pop(); @Override List<C> getHistory(); @Override void setMaxSize(int size); @Override void clear(); @Override boolean isEmpty(); @Override void setRegistryChangeListener(final RegistryChangeListener registryChangeListener);  }
@Test public void testPop() { commandRegistry.pop(); verify(kogitoJSCommandRegistry).pop(); verify(registryChangeListener).notifyRegistryChange(); }