Implement the createNameList method

This commit is contained in:
Manuel Thalmann 2022-10-04 21:36:02 +02:00
parent 73374ed7bb
commit 1a1351c38f
2 changed files with 3 additions and 3 deletions

View file

@ -60,8 +60,9 @@ public class RankingListServer implements CommandExecutor {
} }
public String createNameList(List<Competitor> competitorList) { public String createNameList(List<Competitor> competitorList) {
// TODO Implement return String.join(
return ""; System.lineSeparator(),
competitorList.stream().sorted(new AlphaComparatorCompetitor()).map((competitor) -> competitor.toString()).toList());
} }
public String execute(String rankingList) { public String execute(String rankingList) {

View file

@ -3,7 +3,6 @@ package ch.nuth.zhaw.exbox;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import java.util.Collections;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;