ImageItem extends GenericItem { @Override public void setState(State state) { if (isAcceptedState(acceptedDataTypes, state)) { super.setState(state); } else { logSetTypeError(state); } } ImageItem(String name); @Override List<Class<? extends State>> getAcceptedDataTypes(); @Override List<Class<? extends Command>> getAcceptedCommandTypes(); @Override void setState(State state);  }
@Test public void testRawType() { ImageItem item = new ImageItem("test"); State state = new RawType(new byte[0], "application/octet-stream"); item.setState(state); assertEquals(state, item.getState()); }