code: public boolean delete(final Txn<T> txn, final T key, final T val) {
      if (SHOULD_CHECK) {
        requireNonNull(txn);
        requireNonNull(key);
        txn.checkReady();
        txn.checkWritesAllowed();
      }
  
      txn.kv().keyIn(key);
  
      Pointer data = null;
      if (val != null) {
        txn.kv().valIn(val);
        data = txn.kv().pointerVal();
      }
      final int rc = LIB.mdb_del(txn.pointer(), ptr, txn.kv().pointerKey(), data);
      if (rc == MDB_NOTFOUND) {
        return false;
      }
      checkRc(rc);
      return true;
    }
docs: Removes key/data pairs from the database.
  
  <p>
  If the database does not support sorted duplicate data items
  ({@link DbiFlags#MDB_DUPSORT}) the value parameter is ignored. If the
  database supports sorted duplicates and the value parameter is null, all of
  the duplicate data items for the key will be deleted. Otherwise, if the
  data parameter is non-null only the matching data item will be deleted.
  
  @param txn transaction handle (not null; not committed; must be R-W)
  @param key key to delete from the database (not null)
  @param val value to delete from the database (null permitted)
  @return true if the key/data pair was found, false otherwise