### Question:
DayOfWeekConfig extends FilterConfig { @Override public Condition generate(Map<String, Object> values) { Preconditions.checkState(days != null, "must specify days"); Preconditions.checkState(getCondition() != null, "must specify delegate"); Set<DayOfWeek> days = FunctionFactory.toSetOfDays(this.days.toTemplate(), values); return new DayOfWeekFilter(generateDelegate(values), days); }  TemplatedExpression getDayExpression(); void setDayExpression(TemplatedExpression days); @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() { DayOfWeekConfig empty = new DayOfWeekConfig(); try { empty.generate(ImmutableMap.of("day", "FEBTOBER")); fail("Allowed to be creqted with missing attributes"); } catch(IllegalStateException e) { } }
@Test public void testItsAllAlright() { DayOfWeekConfig config = createFullConfig(); Condition condition = config.generate(ImmutableMap.of("day", "WEDNESDAY")); assertTrue(condition instanceof DayOfWeekFilter); }