JdbcProofOfWorkRepository extends JdbcHelper implements ProofOfWorkRepository, InternalContext.ContextHolder { @Override public void removeObject(byte[] initialHash) { try ( Connection connection = config.getConnection(); PreparedStatement ps = connection.prepareStatement("DELETE FROM POW WHERE initial_hash=?") ) { ps.setBytes(1, initialHash); ps.executeUpdate(); } catch (SQLException e) { LOG.debug(e.getMessage(), e); } } JdbcProofOfWorkRepository(JdbcConfig config); @Override Item getItem(byte[] initialHash); @Override List<byte[]> getItems(); @Override void putObject(Item item); @Override void putObject(ObjectMessage object, long nonceTrialsPerByte, long extraBytes); @Override void removeObject(byte[] initialHash); @Override void setContext(InternalContext context);  }
@Test public void ensureDeletionOfNonexistingItemIsHandledSilently() { repo.removeObject(new byte[0]); }