### Question:
DefaultValueUtilities { public static void updateNewNodeName(final Graph<?, Node> graph, final DMNModelInstrumentedBase dmnModel) { if (dmnModel instanceof NamedElement) { if (isNameAlreadySet((NamedElement) dmnModel)) { return; } } if (dmnModel instanceof BusinessKnowledgeModel) { updateBusinessKnowledgeModelDefaultName(graph, (BusinessKnowledgeModel) dmnModel); } else if (dmnModel instanceof Decision) { updateDecisionDefaultName(graph, (Decision) dmnModel); } else if (dmnModel instanceof InputData) { updateInputDataDefaultName(graph, (InputData) dmnModel); } else if (dmnModel instanceof KnowledgeSource) { updateKnowledgeSourceDefaultName(graph, (KnowledgeSource) dmnModel); } else if (dmnModel instanceof TextAnnotation) { updateTextAnnotationDefaultText(graph, (TextAnnotation) dmnModel); } else if (dmnModel instanceof DecisionService) { updateDecisionServiceDefaultName(graph, (DecisionService) dmnModel); } else { throw new IllegalArgumentException("Default Name for '" + dmnModel.getClass().getSimpleName() + "' is not supported."); } }  static void updateNewNodeName(final Graph<?, Node> graph,
                                         final DMNModelInstrumentedBase dmnModel); static Optional<Integer> extractIndex(final String text,
                                                 final String prefix); static int getMaxUnusedIndex(final Collection<String> values,
                                        final String prefix);  }### Answer:
@Test(expected = IllegalArgumentException.class) public void testUpdateNewNodeName_UnhandledType() { DefaultValueUtilities.updateNewNodeName(graph, new LiteralExpression()); }
@Test public void testUpdateNewNodeNameWhenNomeIsAlreadySet() { final String existingName = "existingName"; final NamedElement dec = mock(NamedElement.class); final Name name = new Name(); name.setValue(existingName); when(dec.getName()).thenReturn(name); DefaultValueUtilities.updateNewNodeName(graph, dec); assertEquals(existingName, dec.getName().getValue()); }