### Question:
FunctionDefaultValueUtilities { public static String getNewParameterName(final FunctionDefinition function) { return PREFIX + DefaultValueUtilities.getMaxUnusedIndex(function.getFormalParameter().stream() .filter(informationItem -> informationItem != null) .map(InformationItem::getName) .filter(name -> name != null) .map(Name::getValue) .collect(Collectors.toList()), PREFIX); }  static String getNewParameterName(final FunctionDefinition function); static final String PREFIX; }### Answer:
@Test public void testGetNewParameterName() { final InformationItem informationItem1 = new InformationItem(); function.getFormalParameter().add(informationItem1); informationItem1.getName().setValue(FunctionDefaultValueUtilities.getNewParameterName(function)); assertThat(informationItem1.getName().getValue()).isEqualTo(FunctionDefaultValueUtilities.PREFIX + "1"); final InformationItem informationItem2 = new InformationItem(); function.getFormalParameter().add(informationItem2); informationItem2.getName().setValue(FunctionDefaultValueUtilities.getNewParameterName(function)); assertThat(informationItem2.getName().getValue()).isEqualTo(FunctionDefaultValueUtilities.PREFIX + "2"); }
@Test public void testGetNewParameterNameWithExistingParameters() { final InformationItem informationItem1 = new InformationItem(); function.getFormalParameter().add(informationItem1); informationItem1.getName().setValue("parameter"); final InformationItem informationItem2 = new InformationItem(); function.getFormalParameter().add(informationItem2); informationItem2.getName().setValue(FunctionDefaultValueUtilities.getNewParameterName(function)); assertThat(informationItem2.getName().getValue()).isEqualTo(FunctionDefaultValueUtilities.PREFIX + "1"); }
@Test public void testGetNewParameterNameWithDeletion() { final InformationItem informationItem1 = new InformationItem(); function.getFormalParameter().add(informationItem1); informationItem1.getName().setValue(FunctionDefaultValueUtilities.getNewParameterName(function)); assertThat(informationItem1.getName().getValue()).isEqualTo(FunctionDefaultValueUtilities.PREFIX + "1"); final InformationItem informationItem2 = new InformationItem(); function.getFormalParameter().add(informationItem2); informationItem2.getName().setValue(FunctionDefaultValueUtilities.getNewParameterName(function)); assertThat(informationItem2.getName().getValue()).isEqualTo(FunctionDefaultValueUtilities.PREFIX + "2"); function.getFormalParameter().remove(informationItem1); final InformationItem informationItem3 = new InformationItem(); function.getFormalParameter().add(informationItem3); informationItem3.getName().setValue(FunctionDefaultValueUtilities.getNewParameterName(function)); assertThat(informationItem3.getName().getValue()).isEqualTo(FunctionDefaultValueUtilities.PREFIX + "3"); }