### Question:
JpaUserRepository implements UserRepository { @Override public User get(String id) { long primaryKey = Long.parseLong(id); return manager.find(JpaUser.class, primaryKey); }  @Override User getByUsername(String username); @Override User getByUserEmail(String userEmail); @Override User getByOpenId(String openId); @Override List<User> getAll(); @Override List<User> getLimitedList(int offset, int pageSize); @Override int getCountAll(); @Override List<User> findByUsernameOrEmail(String searchTerm, int offset, int pageSize); @Override int getCountByUsernameOrEmail(String searchTerm); @Override List<User> getAllByAddedWidget(String widgetId); @Override User getByForgotPasswordHash(String hash); @Override Class<? extends User> getType(); @Override User get(String id); @Override User save(User item); @Override void delete(User item);  }### Answer:
@Test public void getById_validId() { User user = repository.get(USER_ID.toString()); assertThat(user, notNullValue()); assertThat(user.getUsername(), is(equalTo(USER_NAME))); passwordEncoder.encode(USER_NAME); assertThat(true, is(passwordEncoder.matches(USER_NAME, user.getPassword()))); assertThat(user.isAccountNonExpired(), is(true)); assertThat(user.getEmail(), is(equalTo(USER_EMAIL))); }
@Test public void getById_invalidId() { User user = repository.get(INVALID_USER.toString()); assertThat(user, is(nullValue())); }
@Test public void getByUsername_invalid() { User user = repository.get(INVALID_USER.toString()); assertThat(user, is(nullValue())); }