### Question:
DMNSafeDeleteNodeCommand extends SafeDeleteNodeCommand { @Override public boolean shouldKeepChildren(final Node<Definition<?>, Edge> candidate) { return DefinitionUtils.getElementDefinition(candidate) instanceof DecisionService; } DMNSafeDeleteNodeCommand(final Node<?, Edge> node,
                                    final SafeDeleteNodeCommandCallback safeDeleteCallback,
                                    final Options options,
                                    final GraphsProvider graphsProvider); @Override boolean shouldKeepChildren(final Node<Definition<?>, Edge> candidate); @Override GraphsProvider getGraphsProvider();  }### Answer:
@Test public void testShouldKeepChildren() { final DecisionService decisionService = mock(DecisionService.class); final Node<Definition<?>, Edge> candidate = mock(Node.class); final DMNSafeDeleteNodeCommand cmd = createMock(decisionService, candidate); final boolean actual = cmd.shouldKeepChildren(candidate); assertTrue(actual); }
@Test public void testShouldKeepChildrenWhenIsNotDecisionService() { final Object decisionService = mock(Object.class); final Node<Definition<?>, Edge> candidate = mock(Node.class); final DMNSafeDeleteNodeCommand cmd = createMock(decisionService, candidate); final boolean actual = cmd.shouldKeepChildren(candidate); assertFalse(actual); }