@Override
  public boolean isIn(String ipAddress) {
    //is cache expired
    //Uses Double Checked Locking using volatile
    if (cacheExpiryTimeStamp >= 0 && cacheExpiryTimeStamp < System.currentTimeMillis()) {
      synchronized(this) {
        //check if cache expired again
        if (cacheExpiryTimeStamp < System.currentTimeMillis()) {
          reset();
        }
      }
    }
    return ipList.isIn(ipAddress);
  }
@Test
  public void testAddWithSleepForCacheTimeout() throws IOException, InterruptedException {

    String[] ips = {"10.119.103.112", "10.221.102.0/23", "10.113.221.221"};

    TestFileBasedIPList.createFileWithEntries ("ips.txt", ips);

    CacheableIPList cipl = new CacheableIPList(
        new FileBasedIPList("ips.txt"),100);

    assertFalse("10.113.221.222 is in the list",
        cipl.isIn("10.113.221.222"));
    assertFalse ("10.222.103.121 is  in the list",
        cipl.isIn("10.222.103.121"));

    TestFileBasedIPList.removeFile("ips.txt");
    String[]ips2 = {"10.119.103.112", "10.221.102.0/23",
        "10.222.0.0/16", "10.113.221.221", "10.113.221.222"};

    TestFileBasedIPList.createFileWithEntries ("ips.txt", ips2);
    Thread.sleep(101);

    assertTrue("10.113.221.222 is not in the list",
        cipl.isIn("10.113.221.222"));
    assertTrue ("10.222.103.121 is not in the list",
        cipl.isIn("10.222.103.121"));

    TestFileBasedIPList.removeFile("ips.txt");
  }