diff --git a/src/main/java/laddergame/view/util/LadderResultFormatter.java b/src/main/java/laddergame/view/util/LadderResultFormatter.java index fb43759e70..140607b145 100644 --- a/src/main/java/laddergame/view/util/LadderResultFormatter.java +++ b/src/main/java/laddergame/view/util/LadderResultFormatter.java @@ -29,17 +29,16 @@ private static int computePointWidth(List players, List results) return Math.max(computeWordMaxLength(players), computeWordMaxLength(results)); } - private static int computeWordMaxLength(List players) { - return players.stream() + private static int computeWordMaxLength(List words) { + return words.stream() .map(String::length) .max(Integer::compareTo) - .orElseThrow(() -> new IllegalArgumentException("게임 참여자 정보가 존재하지 않습니다.")); + .orElseThrow(() -> new IllegalArgumentException("변환할 단어가 존재하지 않습니다.")); } - private static String extractWords(List players, int pointWidth) { - String nameFormat = "%" + pointWidth + "s"; - return players.stream() - .map(name -> String.format(nameFormat, name)) + private static String extractWords(List words, int pointWidth) { + return words.stream() + .map(name -> String.format("%" + pointWidth + "s", name)) .collect(Collectors.joining(" ")); }