@Test
void notHealthyFastFailure() {

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