### Question:
MultiplicationServiceImpl implements MultiplicationService { @Override public List<MultiplicationResultAttempt> getStatsForUser(final String userAlias) { return attemptRepository.findTop5ByUserAliasOrderByIdDesc(userAlias); } @Autowired  MultiplicationServiceImpl(final RandomGeneratorService randomGeneratorService,
                                     final MultiplicationResultAttemptRepository attemptRepository,
                                     final UserRepository userRepository,
                                     final EventDispatcher eventDispatcher); @Override Multiplication createRandomMultiplication(); @Transactional @Override boolean checkAttempt(final MultiplicationResultAttempt attempt); @Override List<MultiplicationResultAttempt> getStatsForUser(final String userAlias); @Override MultiplicationResultAttempt getResultById(final Long resultId);  }### Answer:
@Test public void retrieveStatsTest() { Multiplication multiplication = new Multiplication(50, 60); User user = new User("john_doe"); MultiplicationResultAttempt attempt1 = new MultiplicationResultAttempt( user, multiplication, 3010, false); MultiplicationResultAttempt attempt2 = new MultiplicationResultAttempt( user, multiplication, 3051, false); List<MultiplicationResultAttempt> latestAttempts = Lists.newArrayList(attempt1, attempt2); given(userRepository.findByAlias("john_doe")).willReturn(Optional.empty()); given(attemptRepository.findTop5ByUserAliasOrderByIdDesc("john_doe")) .willReturn(latestAttempts); List<MultiplicationResultAttempt> latestAttemptsResult = multiplicationServiceImpl.getStatsForUser("john_doe"); assertThat(latestAttemptsResult).isEqualTo(latestAttempts); }