@Test @SuppressWarnings("unchecked") public void testExecuteOnNull() { Object obj = mock(Object.class); CommandManager manager = mock(CommandManager.class); when(commandRegistry.isEmpty()).thenReturn(true); RedoCommandHandler tested = new RedoCommandHandler(commandRegistry, registerChangedEvent); assertEquals(GraphCommandResultBuilder.SUCCESS, tested.execute(obj, manager)); verify(manager, never()).execute(anyObject(), any(Command.class)); }
@SuppressWarnings("unchecked") public CommandResult<?> execute(final Object context, final CommandManager commandManager) { if (registry.isEmpty()) { return GraphCommandResultBuilder.SUCCESS; } final C last = registry.peek(); return commandManager.execute(context, last); }
RedoCommandHandler { @SuppressWarnings("unchecked") public CommandResult<?> execute(final Object context, final CommandManager commandManager) { if (registry.isEmpty()) { return GraphCommandResultBuilder.SUCCESS; } final C last = registry.peek(); return commandManager.execute(context, last); } }
RedoCommandHandler { @SuppressWarnings("unchecked") public CommandResult<?> execute(final Object context, final CommandManager commandManager) { if (registry.isEmpty()) { return GraphCommandResultBuilder.SUCCESS; } final C last = registry.peek(); return commandManager.execute(context, last); } protected  RedoCommandHandler(); @Inject  RedoCommandHandler(final DefaultRegistry<C> registry, final Event<RegisterChangedEvent> registerChangedEvent); }
RedoCommandHandler { @SuppressWarnings("unchecked") public CommandResult<?> execute(final Object context, final CommandManager commandManager) { if (registry.isEmpty()) { return GraphCommandResultBuilder.SUCCESS; } final C last = registry.peek(); return commandManager.execute(context, last); } protected  RedoCommandHandler(); @Inject  RedoCommandHandler(final DefaultRegistry<C> registry, final Event<RegisterChangedEvent> registerChangedEvent); boolean onUndoCommandExecuted(final C command); boolean onCommandExecuted(final C command); @SuppressWarnings("unchecked") CommandResult<?> execute(final Object context,
                                    final CommandManager commandManager); void setSession(final ClientSession clientSession); boolean isEnabled(); void clear(); }
RedoCommandHandler { @SuppressWarnings("unchecked") public CommandResult<?> execute(final Object context, final CommandManager commandManager) { if (registry.isEmpty()) { return GraphCommandResultBuilder.SUCCESS; } final C last = registry.peek(); return commandManager.execute(context, last); } protected  RedoCommandHandler(); @Inject  RedoCommandHandler(final DefaultRegistry<C> registry, final Event<RegisterChangedEvent> registerChangedEvent); boolean onUndoCommandExecuted(final C command); boolean onCommandExecuted(final C command); @SuppressWarnings("unchecked") CommandResult<?> execute(final Object context,
                                    final CommandManager commandManager); void setSession(final ClientSession clientSession); boolean isEnabled(); void clear();  }