// Path: src/main/java/org/lmdbjava/ByteBufferProxy.java
// public static final BufferProxy<ByteBuffer> PROXY_OPTIMAL;
// 
// Path: src/main/java/org/lmdbjava/DirectBufferProxy.java
// public static final BufferProxy<DirectBuffer> PROXY_DB
//     = new DirectBufferProxy();
// 
// Path: src/main/java/org/lmdbjava/Env.java
// public static Builder<ByteBuffer> create() {
//   return new Builder<>(PROXY_OPTIMAL);
// }
// 
// Path: src/main/java/org/lmdbjava/CursorIterable.java
// public static final class KeyVal<T> {
// 
//   private T k;
//   private T v;
// 
//   /**
//    * The key.
//    *
//    * @return key
//    */
//   public T key() {
//     return k;
//   }
// 
//   /**
//    * The value.
//    *
//    * @return value
//    */
//   public T val() {
//     return v;
//   }
// 
//   void setK(final T key) {
//     this.k = key;
//   }
// 
//   void setV(final T val) {
//     this.v = val;
//   }
// 
// }


import static java.nio.ByteBuffer.allocateDirect;
import static java.nio.charset.StandardCharsets.UTF_8;
import static java.util.concurrent.Executors.newCachedThreadPool;
import static java.util.concurrent.TimeUnit.SECONDS;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.hamcrest.CoreMatchers.startsWith;
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_DUPSORT;
import static org.lmdbjava.DirectBufferProxy.PROXY_DB;
import static org.lmdbjava.Env.create;
import static org.lmdbjava.GetOp.MDB_SET;
import static org.lmdbjava.SeekOp.MDB_FIRST;
import static org.lmdbjava.SeekOp.MDB_LAST;
import static org.lmdbjava.SeekOp.MDB_PREV;
import java.io.File;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.concurrent.ExecutorService;
import org.agrona.DirectBuffer;
import org.agrona.MutableDirectBuffer;
import org.agrona.concurrent.UnsafeBuffer;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.lmdbjava.CursorIterable.KeyVal;
      assertThat(count, is(3L));

      // Let's position the Cursor. Note sorting still works.
      c.seek(MDB_FIRST);
      assertThat(UTF_8.decode(c.val()).toString(), is("kkk"));

      c.seek(MDB_LAST);
      assertThat(UTF_8.decode(c.val()).toString(), is("xxx"));

      c.seek(MDB_PREV);
      assertThat(UTF_8.decode(c.val()).toString(), is("lll"));

      c.close();
      txn.commit();
    }

    env.close();
  }

  /**
   * Next up we'll show you how to easily check your platform (operating system
   * and Java version) is working properly with LmdbJava and the embedded LMDB
   * native library.
   *
   * @throws IOException if a path was unavailable for memory mapping
   */
  @Test
  @SuppressWarnings("ConvertToTryWithResources")
  public void tutorial6() throws IOException {
    // Note we need to specify the Verifier's DBI_COUNT for the Env.
// Path: src/main/java/org/lmdbjava/ByteBufferProxy.java
// public static final BufferProxy<ByteBuffer> PROXY_OPTIMAL;
// 
// Path: src/main/java/org/lmdbjava/DirectBufferProxy.java
// public static final BufferProxy<DirectBuffer> PROXY_DB
//     = new DirectBufferProxy();
// 
// Path: src/main/java/org/lmdbjava/Env.java
// public static Builder<ByteBuffer> create() {
//   return new Builder<>(PROXY_OPTIMAL);
// }
// 
// Path: src/main/java/org/lmdbjava/CursorIterable.java
// public static final class KeyVal<T> {
// 
//   private T k;
//   private T v;
// 
//   /**
//    * The key.
//    *
//    * @return key
//    */
//   public T key() {
//     return k;
//   }
// 
//   /**
//    * The value.
//    *
//    * @return value
//    */
//   public T val() {
//     return v;
//   }
// 
//   void setK(final T key) {
//     this.k = key;
//   }
// 
//   void setV(final T val) {
//     this.v = val;
//   }
// 
// }


// Path: src/test/java/org/lmdbjava/TutorialTest.java
import static java.nio.ByteBuffer.allocateDirect;
import static java.nio.charset.StandardCharsets.UTF_8;
import static java.util.concurrent.Executors.newCachedThreadPool;
import static java.util.concurrent.TimeUnit.SECONDS;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.hamcrest.CoreMatchers.startsWith;
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_DUPSORT;
import static org.lmdbjava.DirectBufferProxy.PROXY_DB;
import static org.lmdbjava.Env.create;
import static org.lmdbjava.GetOp.MDB_SET;
import static org.lmdbjava.SeekOp.MDB_FIRST;
import static org.lmdbjava.SeekOp.MDB_LAST;
import static org.lmdbjava.SeekOp.MDB_PREV;
import java.io.File;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.concurrent.ExecutorService;
import org.agrona.DirectBuffer;
import org.agrona.MutableDirectBuffer;
import org.agrona.concurrent.UnsafeBuffer;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.lmdbjava.CursorIterable.KeyVal;

      assertThat(count, is(3L));

      // Let's position the Cursor. Note sorting still works.
      c.seek(MDB_FIRST);
      assertThat(UTF_8.decode(c.val()).toString(), is("kkk"));

      c.seek(MDB_LAST);
      assertThat(UTF_8.decode(c.val()).toString(), is("xxx"));

      c.seek(MDB_PREV);
      assertThat(UTF_8.decode(c.val()).toString(), is("lll"));

      c.close();
      txn.commit();
    }

    env.close();
  }

  /**
   * Next up we'll show you how to easily check your platform (operating system
   * and Java version) is working properly with LmdbJava and the embedded LMDB
   * native library.
   *
   * @throws IOException if a path was unavailable for memory mapping
   */
  @Test
  @SuppressWarnings("ConvertToTryWithResources")
  public void tutorial6() throws IOException {
    // Note we need to specify the Verifier's DBI_COUNT for the Env.
    final Env<ByteBuffer> env = create(PROXY_OPTIMAL)