DefaultActionGroup extends ActionGroup { public final void add(Action action, ActionManager actionManager) { add(action, new Constraints(Anchor.LAST, null), actionManager); } DefaultActionGroup(ActionManager actionManager);  DefaultActionGroup(ActionManager actionManager, Action... actions);  DefaultActionGroup(String shortName, boolean popup, ActionManager actionManager); final void add(Action action, ActionManager actionManager); final void add(Action action); final ActionInGroup addAction(Action action); final void addSeparator(); final void add(Action action, Constraints constraint); final ActionInGroup addAction(Action action, Constraints constraint); final void add(Action action, Constraints constraint, ActionManager actionManager); final ActionInGroup addAction(Action action, Constraints constraint, ActionManager actionManager); final void remove(Action actionToRemove); final void removeAll(); @Override final Action[] getChildren(ActionEvent e); final int getChildrenCount(); final Action[] getChildActionsOrStubs(); final void addAll(ActionGroup group); final void addAll(Collection<Action> actionList); final void addAll(Action... actions); void addSeparator(String separatorText);  }
@Test(expected = IllegalArgumentException.class) public void shouldNotAddSameActionTwice() { Action action = mock(Action.class); defaultActionGroup.add(action, new Constraints(AFTER, "someAction")); defaultActionGroup.add(action, new Constraints(BEFORE, "someAction")); }