// Path: src/main/java/org/lmdbjava/ByteBufferProxy.java
// public static final BufferProxy<ByteBuffer> PROXY_OPTIMAL;
// 
// Path: src/main/java/org/lmdbjava/Env.java
// public static Builder<ByteBuffer> create() {
//   return new Builder<>(PROXY_OPTIMAL);
// }
// 
// Path: src/test/java/org/lmdbjava/TestUtils.java
// public static final String DB_1 = "test-db-1";
// 
// Path: src/test/java/org/lmdbjava/TestUtils.java
// @SuppressWarnings("PMD.AvoidUsingOctalValues")
// public static final int POSIX_MODE = 0664;
// 
// Path: src/test/java/org/lmdbjava/TestUtils.java
// static ByteBuffer bb(final int value) {
//   final ByteBuffer bb = allocateDirect(BYTES);
//   bb.putInt(value).flip();
//   return bb;
// }
// 
// Path: src/main/java/org/lmdbjava/Cursor.java
// public static final class ClosedException extends LmdbException {
// 
//   private static final long serialVersionUID = 1L;
// 
//   /**
//    * Creates a new instance.
//    */
//   public ClosedException() {
//     super("Cursor has already been closed");
//   }
// }
// 
// Path: src/main/java/org/lmdbjava/Txn.java
// public static final class NotReadyException extends LmdbException {
// 
//   private static final long serialVersionUID = 1L;
// 
//   /**
//    * Creates a new instance.
//    */
//   public NotReadyException() {
//     super("Transaction is not in ready state");
//   }
// }
// 
// Path: src/main/java/org/lmdbjava/Txn.java
// public static class ReadOnlyRequiredException extends LmdbException {
// 
//   private static final long serialVersionUID = 1L;
// 
//   /**
//    * Creates a new instance.
//    */
//   public ReadOnlyRequiredException() {
//     super("Not a read-only transaction");
//   }
// }


import static com.jakewharton.byteunits.BinaryByteUnit.KIBIBYTES;
import static java.lang.Long.BYTES;
import static java.lang.Long.MIN_VALUE;
import static java.nio.ByteBuffer.allocateDirect;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.lmdbjava.ByteBufferProxy.PROXY_OPTIMAL;
import static org.lmdbjava.DbiFlags.MDB_CREATE;
import static org.lmdbjava.DbiFlags.MDB_DUPFIXED;
import static org.lmdbjava.DbiFlags.MDB_DUPSORT;
import static org.lmdbjava.Env.create;
import static org.lmdbjava.EnvFlags.MDB_NOSUBDIR;
import static org.lmdbjava.PutFlags.MDB_APPENDDUP;
import static org.lmdbjava.PutFlags.MDB_MULTIPLE;
import static org.lmdbjava.PutFlags.MDB_NODUPDATA;
import static org.lmdbjava.PutFlags.MDB_NOOVERWRITE;
import static org.lmdbjava.SeekOp.MDB_FIRST;
import static org.lmdbjava.SeekOp.MDB_GET_BOTH;
import static org.lmdbjava.TestUtils.DB_1;
import static org.lmdbjava.TestUtils.POSIX_MODE;
import static org.lmdbjava.TestUtils.bb;
import java.io.File;
import java.io.IOException;
import java.nio.ByteBuffer;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.lmdbjava.Cursor.ClosedException;
import org.lmdbjava.Txn.NotReadyException;
import org.lmdbjava.Txn.ReadOnlyRequiredException;
    }
  }

  @Test(expected = IllegalArgumentException.class)
  public void putMultipleWithoutMdbMultipleFlag() {
    final Dbi<ByteBuffer> db = env.openDbi(DB_1, MDB_CREATE, MDB_DUPSORT);
    try (Txn<ByteBuffer> txn = env.txnWrite();
         Cursor<ByteBuffer> c = db.openCursor(txn)) {
      c.putMultiple(bb(100), bb(1), 1);
    }
  }

  @Test
  public void renewTxRo() {
    final Dbi<ByteBuffer> db = env.openDbi(DB_1, MDB_CREATE);

    final Cursor<ByteBuffer> c;
    try (Txn<ByteBuffer> txn = env.txnRead()) {
      c = db.openCursor(txn);
      txn.commit();
    }

    try (Txn<ByteBuffer> txn = env.txnRead()) {
      c.renew(txn);
      txn.commit();
    }

    c.close();
  }

// Path: src/main/java/org/lmdbjava/ByteBufferProxy.java
// public static final BufferProxy<ByteBuffer> PROXY_OPTIMAL;
// 
// Path: src/main/java/org/lmdbjava/Env.java
// public static Builder<ByteBuffer> create() {
//   return new Builder<>(PROXY_OPTIMAL);
// }
// 
// Path: src/test/java/org/lmdbjava/TestUtils.java
// public static final String DB_1 = "test-db-1";
// 
// Path: src/test/java/org/lmdbjava/TestUtils.java
// @SuppressWarnings("PMD.AvoidUsingOctalValues")
// public static final int POSIX_MODE = 0664;
// 
// Path: src/test/java/org/lmdbjava/TestUtils.java
// static ByteBuffer bb(final int value) {
//   final ByteBuffer bb = allocateDirect(BYTES);
//   bb.putInt(value).flip();
//   return bb;
// }
// 
// Path: src/main/java/org/lmdbjava/Cursor.java
// public static final class ClosedException extends LmdbException {
// 
//   private static final long serialVersionUID = 1L;
// 
//   /**
//    * Creates a new instance.
//    */
//   public ClosedException() {
//     super("Cursor has already been closed");
//   }
// }
// 
// Path: src/main/java/org/lmdbjava/Txn.java
// public static final class NotReadyException extends LmdbException {
// 
//   private static final long serialVersionUID = 1L;
// 
//   /**
//    * Creates a new instance.
//    */
//   public NotReadyException() {
//     super("Transaction is not in ready state");
//   }
// }
// 
// Path: src/main/java/org/lmdbjava/Txn.java
// public static class ReadOnlyRequiredException extends LmdbException {
// 
//   private static final long serialVersionUID = 1L;
// 
//   /**
//    * Creates a new instance.
//    */
//   public ReadOnlyRequiredException() {
//     super("Not a read-only transaction");
//   }
// }


// Path: src/test/java/org/lmdbjava/CursorTest.java
import static com.jakewharton.byteunits.BinaryByteUnit.KIBIBYTES;
import static java.lang.Long.BYTES;
import static java.lang.Long.MIN_VALUE;
import static java.nio.ByteBuffer.allocateDirect;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.lmdbjava.ByteBufferProxy.PROXY_OPTIMAL;
import static org.lmdbjava.DbiFlags.MDB_CREATE;
import static org.lmdbjava.DbiFlags.MDB_DUPFIXED;
import static org.lmdbjava.DbiFlags.MDB_DUPSORT;
import static org.lmdbjava.Env.create;
import static org.lmdbjava.EnvFlags.MDB_NOSUBDIR;
import static org.lmdbjava.PutFlags.MDB_APPENDDUP;
import static org.lmdbjava.PutFlags.MDB_MULTIPLE;
import static org.lmdbjava.PutFlags.MDB_NODUPDATA;
import static org.lmdbjava.PutFlags.MDB_NOOVERWRITE;
import static org.lmdbjava.SeekOp.MDB_FIRST;
import static org.lmdbjava.SeekOp.MDB_GET_BOTH;
import static org.lmdbjava.TestUtils.DB_1;
import static org.lmdbjava.TestUtils.POSIX_MODE;
import static org.lmdbjava.TestUtils.bb;
import java.io.File;
import java.io.IOException;
import java.nio.ByteBuffer;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.lmdbjava.Cursor.ClosedException;
import org.lmdbjava.Txn.NotReadyException;
import org.lmdbjava.Txn.ReadOnlyRequiredException;

    }
  }

  @Test(expected = IllegalArgumentException.class)
  public void putMultipleWithoutMdbMultipleFlag() {
    final Dbi<ByteBuffer> db = env.openDbi(DB_1, MDB_CREATE, MDB_DUPSORT);
    try (Txn<ByteBuffer> txn = env.txnWrite();
         Cursor<ByteBuffer> c = db.openCursor(txn)) {
      c.putMultiple(bb(100), bb(1), 1);
    }
  }

  @Test
  public void renewTxRo() {
    final Dbi<ByteBuffer> db = env.openDbi(DB_1, MDB_CREATE);

    final Cursor<ByteBuffer> c;
    try (Txn<ByteBuffer> txn = env.txnRead()) {
      c = db.openCursor(txn);
      txn.commit();
    }

    try (Txn<ByteBuffer> txn = env.txnRead()) {
      c.renew(txn);
      txn.commit();
    }

    c.close();
  }

  @Test(expected = ReadOnlyRequiredException.class)