@Test public void testGetNewColumnNameWithExistingColumns() { final InformationItem informationItem1 = new InformationItem(); relation.getColumn().add(informationItem1); informationItem1.getName().setValue("column"); final InformationItem informationItem2 = new InformationItem(); relation.getColumn().add(informationItem2); informationItem2.getName().setValue(RelationDefaultValueUtilities.getNewColumnName(relation)); assertThat(informationItem2.getName().getValue()).isEqualTo(RelationDefaultValueUtilities.PREFIX + "1"); }
public static String getNewColumnName(final Relation relation) { return PREFIX + DefaultValueUtilities.getMaxUnusedIndex(relation.getColumn().stream() .filter(informationItem -> informationItem != null) .map(InformationItem::getName) .filter(name -> name != null) .map(Name::getValue) .collect(Collectors.toList()), PREFIX); }
RelationDefaultValueUtilities { public static String getNewColumnName(final Relation relation) { return PREFIX + DefaultValueUtilities.getMaxUnusedIndex(relation.getColumn().stream() .filter(informationItem -> informationItem != null) .map(InformationItem::getName) .filter(name -> name != null) .map(Name::getValue) .collect(Collectors.toList()), PREFIX); } }
RelationDefaultValueUtilities { public static String getNewColumnName(final Relation relation) { return PREFIX + DefaultValueUtilities.getMaxUnusedIndex(relation.getColumn().stream() .filter(informationItem -> informationItem != null) .map(InformationItem::getName) .filter(name -> name != null) .map(Name::getValue) .collect(Collectors.toList()), PREFIX); }  }
RelationDefaultValueUtilities { public static String getNewColumnName(final Relation relation) { return PREFIX + DefaultValueUtilities.getMaxUnusedIndex(relation.getColumn().stream() .filter(informationItem -> informationItem != null) .map(InformationItem::getName) .filter(name -> name != null) .map(Name::getValue) .collect(Collectors.toList()), PREFIX); }  static String getNewColumnName(final Relation relation); }
RelationDefaultValueUtilities { public static String getNewColumnName(final Relation relation) { return PREFIX + DefaultValueUtilities.getMaxUnusedIndex(relation.getColumn().stream() .filter(informationItem -> informationItem != null) .map(InformationItem::getName) .filter(name -> name != null) .map(Name::getValue) .collect(Collectors.toList()), PREFIX); }  static String getNewColumnName(final Relation relation); static final String PREFIX; }