assertThat(indicesExistsResponse.exists(), equalTo(false));
logger.info("Clearing cache");
ClearIndicesCacheResponse clearIndicesCacheResponse = client1.admin().indices().clearCache(clearIndicesCacheRequest("test")).actionGet();
assertThat(clearIndicesCacheResponse.successfulShards(), equalTo(10));
assertThat(clearIndicesCacheResponse.failedShards(), equalTo(0));
logger.info("Optimizing");
OptimizeResponse optimizeResponse = client1.admin().indices().prepareOptimize("test").execute().actionGet();
assertThat(optimizeResponse.successfulShards(), equalTo(10));
assertThat(optimizeResponse.failedShards(), equalTo(0));