Assert.assertEquals(5706, a2.getVotesPercent());
}
@Test
public void calcAnswerDistribution4() {
Answer a1 = new Answer();
a1.setVotes(0);
Answer a2 = new Answer();
a2.setVotes(1);
Answer a3 = new Answer();
a3.setVotes(4);
Answer a4 = new Answer();
a4.setVotes(1);
List<Answer> answers = new ArrayList<Answer>();
answers.add(a1);
answers.add(a2);
answers.add(a3);
answers.add(a4);
StatsService statsService = new StatsService();
statsService.calcAnswerDistribution(answers);
Assert.assertEquals(0, a1.getVotesPercent());
Assert.assertEquals(1666, a2.getVotesPercent());
Assert.assertEquals(6667, a3.getVotesPercent());
Assert.assertEquals(1667, a4.getVotesPercent());
}