TimeStringValuePredicate implements ValuePredicate<String> { @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("TimeStringValuePredicate [valueFormat="); builder.append(valueFormat); builder.append(", inputFormat="); builder.append(inputFormat); builder.append(", value="); builder.append(value); builder.append(", fnName="); builder.append(fnName); builder.append(", inputTimeFormatter="); builder.append(inputTimeFormatter); builder.append(", timePredicate="); builder.append(timePredicate); builder.append("]"); return builder.toString(); } TimeStringValuePredicate(String valueFormat, String inputFormat, String value, String fnName); @Override boolean apply(@Nullable String input); String getValue(); String getValueFormat(); String getInputFormat(); @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(); String inputFormat = "yyyyMMdd'T'HHmmss.SSSZ"; new TimeStringValuePredicate(valueFormat, inputFormat, toString(now, valueFormat), "~~"); }