### Question:
UserServiceImpl implements UserService { @Override public User getUser(long id) { Optional<User> user = userRepository.findById(id); if (user.isPresent()) { return user.get(); } else { throw new UserNotFoundException("User with id=" + id + " not found"); } } @Autowired  UserServiceImpl(UserRepository userRepository); @Override List<User> getUsers(); @Override User getUser(long id); @Override User addUser(String nickname, String email, String password);  }### Answer:
@Test public void getUser() throws UserNotFoundException { User expected = new User(1L, "user1", "user1@mail.com", "pass"); User actual = userService.getUser(1L); assertEquals(expected, actual); }