  @Test
  public void testStat() throws Exception {

    String path = tmp.newFolder().getCanonicalPath();
    try (Env env = new Env()) {
      env.open(path);
      env.setMapSize(1048576L);
      try (Database db = env.openDatabase()) {
        db.put(new byte[]{1}, new byte[]{1});
        db.put(new byte[]{2}, new byte[]{1});
        Stat stat = env.stat();
        System.out.println(stat);
        assertThat(stat.ms_entries, is(2L));
        assertThat(stat.ms_psize, is(not(0L)));
        assertThat(stat.ms_overflow_pages, is(0L));
        assertThat(stat.ms_depth, is(1L));
        assertThat(stat.ms_leaf_pages, is(1L));
      }
    }
  }