### Question:
OptionDAO { public boolean set(String optionName, String optionValue) { TransactionalDataSource dataSource = databaseManager.getDataSource(); if (!exist(optionName)) { try (Connection con = dataSource.getConnection()) { PreparedStatement stmt = con.prepareStatement("INSERT INTO option (name, \"VALUE\") VALUES (?, ?)"); stmt.setString(1, optionName); stmt.setString(2, optionValue); stmt.execute(); } catch (SQLException e) { log.error("OptionDAO insert error, {}={}, {}", optionName, optionValue, e.getMessage()); } } else { try (Connection con = dataSource.getConnection()) { PreparedStatement stmt = con.prepareStatement("UPDATE option set value = ? WHERE name = ?"); stmt.setString(1, optionValue); stmt.setString(2, optionName); stmt.execute(); } catch (SQLException e) { log.error("OptionDAO update error, {}={}, {}", optionName, optionValue, e.getMessage()); } } return true; } @Inject  OptionDAO(DatabaseManager databaseManager); String get(String optionName); boolean set(String optionName, String optionValue); boolean delete(String optionName); void deleteAll(); boolean exist(String optionKey);  }### Answer:
@Test void set() { String unknown_key = "unknown_key_2"; boolean isInserted = optionDAO.set(unknown_key, "unknown_value"); assertTrue(isInserted); String value = optionDAO.get(unknown_key); assertNotNull(value); assertEquals("unknown_value", value); optionDAO.delete(unknown_key); value = optionDAO.get(unknown_key); assertNull(value); }