private void assertTotalCompoundSegments(int i, int t, String index) {
   IndicesSegmentResponse indicesSegmentResponse =
       client().admin().indices().prepareSegments(index).get();
   IndexSegments indexSegments = indicesSegmentResponse.getIndices().get(index);
   Collection<IndexShardSegments> values = indexSegments.getShards().values();
   int compounds = 0;
   int total = 0;
   for (IndexShardSegments indexShardSegments : values) {
     for (ShardSegments s : indexShardSegments) {
       for (Segment segment : s) {
         if (segment.isSearch() && segment.getNumDocs() > 0) {
           if (segment.isCompound()) {
             compounds++;
           }
           total++;
         }
       }
     }
   }
   assertThat(compounds, Matchers.equalTo(i));
   assertThat(total, Matchers.equalTo(t));
 }