DefaultActionGroup extends ActionGroup { @Override public final Action[] getChildren(ActionEvent e) { if (needSorting) { sortedActions = getSortedActions(); needSorting = false; } return sortedActions == null ? EMPTY_ACTIONS : sortedActions; } 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 public void shouldReturnEmptyArrayWhenThereIsNoActions() { Action[] result = defaultActionGroup.getChildren(mock(ActionEvent.class)); assertThat(Arrays.asList(result)).isEmpty(); }