I have a List of matches. A match has a property called matchIndex. Now I want to set the property of each match in list like this
index = 0 // some predefined value
List<Match> matchList = createMatches(membersList, teamsPerGroup,totalGroups);
matchList.forEach((match) -> {
match.setMatchIndex(index++);
});
I want to set matchIndex of each match in the list by increasing order after local variable index.
final int index = 0;