@Override
  public Predicate<FileInfo> get() {
    long currentTimeMS = System.currentTimeMillis();
    Interval interval = Interval.between(currentTimeMS, currentTimeMS + 1);
    return FileInfo -> {
      try {
        return interval.intersect(mInterval.add(mGetter.apply(FileInfo))).isValid();
      } catch (RuntimeException e) {
        LOG.debug("Failed to filter: ", e);
        return false;
      }
    };
  }
@Test
  public void testDateFromFileNameOlderThan() {
    FileFilter filter = FileFilter.newBuilder().setName("dateFromFileNameOlderThan").setValue("2d")
        .setPattern("YYYYMMDD").build();
    FileInfo info = new FileInfo();
    DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyyMMdd");
    LocalDateTime now = LocalDateTime.now();
    LocalDateTime threeDaysBefore = now.minusDays(3);
    String date = dtf.format(threeDaysBefore);
    info.setName(date);

    assertTrue(FilePredicate.create(filter).get().test(info));

    LocalDateTime oneDayBefore = now.minusDays(1);
    date = dtf.format(oneDayBefore);
    info.setName(date);
    assertFalse(FilePredicate.create(filter).get().test(info));
  }