@Test
public void testFormatEntityList() {

  AbstractCheckDescriptor check = new TestCheckImpl(PrereqCheckType.HOST);
  Assert.assertEquals("", check.formatEntityList(null));
  final LinkedHashSet<String> failedOn = new LinkedHashSet<String>();
  Assert.assertEquals("", check.formatEntityList(failedOn));
  failedOn.add("host1");
  Assert.assertEquals("host1", check.formatEntityList(failedOn));
  failedOn.add("host2");
  Assert.assertEquals("host1 and host2", check.formatEntityList(failedOn));
  failedOn.add("host3");
  Assert.assertEquals("host1, host2 and host3", check.formatEntityList(failedOn));
  check = new TestCheckImpl(PrereqCheckType.CLUSTER);
  Assert.assertEquals("host1, host2 and host3", check.formatEntityList(failedOn));
  check = new TestCheckImpl(PrereqCheckType.SERVICE);
  Assert.assertEquals("host1, host2 and host3", check.formatEntityList(failedOn));
  check = new TestCheckImpl(null);
  Assert.assertEquals("host1, host2 and host3", check.formatEntityList(failedOn));
}