Я хочу создать String с String.format, например, String.format ("Q1 = {}, Q2 = {}, Q3 = {}, Q4 = {}" list) из значений списка, который содержитЦелые числа.
private String createString(Player player){
List<Integer> answers= new ArrayList<>();
answers.add(player.getQuestion1());
answers.add(player.getQuestion2());
answers.add(player.getQuestion3());
answers.add(player.getQuestion4());
answers.add(player.getQuestion5());
answers.add(player.getQuestion6());
answers.add(player.getQuestion7());
answers.add(player.getQuestion8());
answers.add(player.getQuestion9());
answers.add(player.getQuestion10());
return String.format("Q1={}, Q2={}, Q3={}, Q4={}, Q5={}, Q6={}, Q7={}, Q8={}, Q9={}, Q10={}", answers.stream().map(a -> a.toString());
}