private void prepareAlertHolderWithHostAlert(Long alertDefinitionId) {
    AlertDefinitionsHolder alertDefinitionHolder = m_injector.getInstance(AlertDefinitionsHolder.class);
    Long hostId1 = 1L;
    Long hostId2 = 2L;

    AlertDefinition alertDefinition1 = new AlertDefinition();
    alertDefinition1.setDefinitionId(alertDefinitionId);

    AlertCluster alertCluster1host1 = new AlertCluster(Collections.singletonMap(alertDefinitionId, alertDefinition1), "host1");

    AlertCluster alertCluster1host2 = new AlertCluster(Collections.singletonMap(alertDefinitionId, alertDefinition1), "host2");
    AlertDefinitionsAgentUpdateEvent hostUpdate1 = new AlertDefinitionsAgentUpdateEvent(AlertDefinitionEventType.CREATE,
        Collections.singletonMap(1L, alertCluster1host1), "host1", hostId1);
    AlertDefinitionsAgentUpdateEvent hostUpdate2 = new AlertDefinitionsAgentUpdateEvent(AlertDefinitionEventType.CREATE,
        Collections.singletonMap(1L, alertCluster1host2), "host2", hostId2);
    alertDefinitionHolder.setData(hostUpdate1, 1L);
    alertDefinitionHolder.setData(hostUpdate2, 2L);
  }
Tests alerts with ignoreHost == true. Both hosts are in HEARTBEAT_LOST state.
host1:
  cluster1
    alertDefinition1

host2:
  cluster1
    alertDefinition1
ambari-server/src/test/java/org/apache/ambari/server/alerts/StaleAlertRunnableTest.java