PlayerItem extends GenericItem { @Override public void setState(State state) { if (isAcceptedState(acceptedDataTypes, state)) { super.setState(state); } else { logSetTypeError(state); } } PlayerItem(String name);   PlayerItem(String type, String name); @Override List<Class<? extends State>> getAcceptedDataTypes(); @Override List<Class<? extends Command>> getAcceptedCommandTypes(); void send(PlayPauseType command); void send(RewindFastforwardType command); void send(NextPreviousType command); @Override void setState(State state);  }
@Test public void setPlayPause() { PlayerItem item = new PlayerItem("test"); item.setState(PlayPauseType.PLAY); assertEquals(PlayPauseType.PLAY, item.getState()); item.setState(PlayPauseType.PAUSE); assertEquals(PlayPauseType.PAUSE, item.getState()); }
@Test public void setRewindFastforward() { PlayerItem item = new PlayerItem("test"); item.setState(RewindFastforwardType.REWIND); assertEquals(RewindFastforwardType.REWIND, item.getState()); item.setState(RewindFastforwardType.FASTFORWARD); assertEquals(RewindFastforwardType.FASTFORWARD, item.getState()); }