### Question:
TimeOfDayConfig implements ConditionConfig { @Override public Condition generate(Map<String, Object> values) { Preconditions.checkState(timeOfDay != null, "must specify time"); TimeOfDay timeOfDay = FunctionFactory.toTimeOfDay(this.timeOfDay.toTemplate(), values); return new TimeOfDayTrigger(timeOfDay); }  TemplatedExpression getTimeOfDayExpression(); void setTimeOfDayExpression(TemplatedExpression timeOfDayExpression); @Override String getType(); @Override Condition generate(Map<String, Object> values); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); static final String TYPE; }### Answer:
@Test public void testInvalidConfig() { TimeOfDayConfig empty = new TimeOfDayConfig(); try { empty.generate(ImmutableMap.of()); fail("Allowed to be creqted with missing attributes"); } catch(IllegalStateException e) { } }
@Test public void testItsAllAlright() { TimeOfDayConfig config = createFullConfig(); Condition condition = config.generate(ImmutableMap.of("time", "11:15:30")); assertTrue(condition instanceof TimeOfDayTrigger); }