RegistrationService { public User getByEMail(String email) { List<User> result = jdbcTemplate.query( "SELECT firstname, name, email FROM T_USER WHERE email=?", new RowMapper<User>() { @Override public User mapRow(ResultSet rs, int rowNum) throws SQLException { return new User(rs.getString("firstname"), rs .getString("name"), rs.getString("email")); } }, email); if (result.size() > 1) { throw new IllegalStateException( "More than one user with the same email!"); } if (result.size() == 0) { return null; } return result.get(0); }  boolean register(User user); boolean validEMailAdress(String email); User getByEMail(String email); void reset(); void unregister(String email); void clean();  }
@Test public void userNotInitiallyRegistered() { assertNull(registrationService.getByEMail("eberhard.wolff@gmail.com")); }