public boolean includes(String ipAddress) {
    
    if (all) {
      return true;
    }
    
    if (ipAddress == null) {
      throw new IllegalArgumentException("ipAddress is null.");
    }

    try {
      return includes(addressFactory.getByName(ipAddress));
    } catch (UnknownHostException e) {
      return false;
    }
  }
@Test
  public void testStaticIPHostNameList()throws UnknownHostException {
    // create MachineList with a list of of Hostnames
    TestAddressFactory addressFactory = new TestAddressFactory();
    addressFactory.put("1.2.3.1", "host1");
    addressFactory.put("1.2.3.4", "host4");

    MachineList ml = new MachineList(
        StringUtils.getTrimmedStringCollection(HOST_LIST), addressFactory);

    // test for inclusion with an known IP
    assertTrue(ml.includes("1.2.3.4"));

    // test for exclusion with an unknown IP
    assertFalse(ml.includes("1.2.3.5"));
  }