public void testCommitStats() throws Exception {
    createIndex("test");
    ensureGreen("test");

    IndicesStatsResponse rsp = client().admin().indices().prepareStats("test").get();
    for (ShardStats shardStats : rsp.getIndex("test").getShards()) {
      final CommitStats commitStats = shardStats.getCommitStats();
      assertNotNull(commitStats);
      assertThat(commitStats.getGeneration(), greaterThan(0l));
      assertThat(commitStats.getId(), notNullValue());
      assertThat(commitStats.getUserData(), hasKey(Translog.TRANSLOG_GENERATION_KEY));
      assertThat(commitStats.getUserData(), hasKey(Translog.TRANSLOG_UUID_KEY));
    }
  }