### Question:
DbStore implements Store, UserAddressStore { @Override public void update(User newUser) { try (Connection con = SOURCE.getConnection(); PreparedStatement st = con.prepareStatement( PROPS.getProperty("updateUser") )) { st.setString(1, newUser.getName()); st.setString(2, newUser.getLogin()); st.setString(3, newUser.getEmail()); st.setString(4, newUser.getPassword()); st.setString(5, newUser.getRole()); st.setString(6, newUser.getCity()); st.setInt(7, newUser.getId()); st.execute(); } catch (SQLException e) { LOG.error(e.getMessage(), e); } } private  DbStore(); static DbStore getInstance(); @Override User findByLogin(String login); @Override void add(User user); @Override void update(User newUser); @Override void delete(int userId); @Override List<User> findAll(); @Override User findById(int id); List<String> findAllCountries(); List<String> findCitiesByCountry(String name);  }### Answer:
@Test public void update() throws SQLException { int userId = 0; try (Statement st = this.connect.createStatement()) { st.execute("INSERT INTO users (name, login, email) VALUES ('up', 'up', 'up')"); try (ResultSet rstSet = st.executeQuery("SELECT id FROM users WHERE name = 'up'")) { rstSet.next(); userId = rstSet.getInt("id"); } User userUpdated = new User("test", "test", "test", "user", "test"); userUpdated.setId(userId); this.testStore.update(userUpdated); try (ResultSet rstSet = st.executeQuery("SELECT name, login, email FROM users WHERE id =" + userId)) { assertThat(rstSet.next(), is(true)); assertThat(rstSet.getString("name"), is("test")); assertThat(rstSet.getString("login"), is("test")); assertThat(rstSet.getString("email"), is("test")); assertThat(rstSet.next(), is(false)); } } }