@Test
void notHealthyWithRetry() {

  when(memoryMonitor.isMemoryHealthy(anyLong())).thenThrow(
      ElasticsearchMemoryHealthy.MemoryUsageExceedException.class);
  ElasticsearchResourceMonitor resourceMonitor =
      new ElasticsearchResourceMonitor(settings, memoryMonitor);
  assertFalse(resourceMonitor.isHealthy());
  verify(memoryMonitor, times(3)).isMemoryHealthy(anyLong());
}