### Question:
BPMNProjectActionsToolboxFactory extends AbstractActionsToolboxFactory { @Override public Collection<ToolboxAction<AbstractCanvasHandler>> getActions(final AbstractCanvasHandler canvasHandler, final Element<?> e) { final List<ToolboxAction<AbstractCanvasHandler>> actions = new LinkedList<>(); actions.addAll(commonActionToolbox.getActions(canvasHandler, e)); if (BPMNFormsContextUtils.isFormGenerationSupported(e)) { actions.add(generateFormsActions.get()); } return actions; } @Inject  BPMNProjectActionsToolboxFactory(final @CommonActionsToolbox ActionsToolboxFactory commonActionToolbox,
                                            final @Any ManagedInstance<FormGenerationToolboxAction> generateFormsActions,
                                            final @Any @CommonActionsToolbox ManagedInstance<ActionsToolboxView> views); @Override Collection<ToolboxAction<AbstractCanvasHandler>> getActions(final AbstractCanvasHandler canvasHandler,
                                                                       final Element<?> e); @PreDestroy void destroy();  }### Answer:
@Test @SuppressWarnings("unchecked") public void testGetActionsForSupportedNode() { element.setContent(new ViewImpl<>(new UserTask(), Bounds.create())); final Collection<ToolboxAction<AbstractCanvasHandler>> actions = tested.getActions(canvasHandler, element); assertEquals(2, actions.size()); assertTrue(actions.contains(action1)); assertTrue(actions.contains(formGenerationToolboxAction)); }
@Test @SuppressWarnings("unchecked") public void testGetActionsForNotSupportedNode() { element.setContent(new ViewImpl<>(new ScriptTask(), Bounds.create())); final Collection<ToolboxAction<AbstractCanvasHandler>> actions = tested.getActions(canvasHandler, element); assertEquals(1, actions.size()); assertTrue(actions.contains(action1)); assertFalse(actions.contains(formGenerationToolboxAction)); }