DateTimeItem extends GenericItem { @Override public void setState(State state) { if (isAcceptedState(acceptedDataTypes, state)) { State convertedState = state.as(DateTimeType.class); if (convertedState != null) { applyState(convertedState); } else { applyState(state); } } else { logSetTypeError(state); } } DateTimeItem(String name); @Override List<Class<? extends State>> getAcceptedDataTypes(); @Override List<Class<? extends Command>> getAcceptedCommandTypes(); void send(DateTimeType command); @Override void setState(State state);  }
@Test public void testDateTimeType() { DateTimeItem item = new DateTimeItem("test"); DateTimeType state = new DateTimeType(); item.setState(state); assertEquals(state, item.getState()); }