TimeMillisValuePredicate implements ValuePredicate<Long> { @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("TimeMillisValuePredicate [timeFormat="); builder.append(timeFormat); builder.append(", value="); builder.append(value); builder.append(", fnName="); builder.append(fnName); builder.append(", longPredicate="); builder.append(longPredicate); builder.append("]"); return builder.toString(); } TimeMillisValuePredicate(String timeFormat, String value, String fnName); @Override boolean apply(@Nullable Long input); String getValue(); String getTimeFormat(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test(expected=IllegalArgumentException.class) public void testInvalidFunctionNameShouldBeRejected() { String valueFormat = "YYYY-MM-dd HH:mm:ss:SSS"; long now = new Date().getTime(); new TimeMillisValuePredicate(valueFormat, toString(now, valueFormat), "~~"); }