### Question:
DBIMADeviceStateManager extends DBDeviceStateManager implements IMADeviceStateManager { @Override public final IMADeviceState getState(final Device device) throws IMADeviceStateManagerException { try { return (IMADeviceState) super.getState(device, IMADeviceState.class); } catch (DeviceStateManagerException e) { throw new IMADeviceStateManagerException(e); } } DBIMADeviceStateManager(final SessionFactory factory); @Override final IMADeviceState saveState(final IMADeviceState state); @Override final IMADeviceState getState(final Device device); @Override final void updateState(final IMADeviceState state); @Override final boolean deleteState(final Device device);  }### Answer:
@Test(expectedExceptions = NullPointerException.class) public void testGetNull() { stateManager.getState(null); }
@Test public void testGetUnknown() { final IMADeviceState savedState = stateManager.getState(device); Assert.assertNull(savedState); }