MicrochipPotentiometerDeviceController { public void setWiperLock(final DeviceControllerChannel channel, final boolean locked) throws IOException { if (channel == null) { throw new RuntimeException("null-channel is not allowed. For devices " + "knowing just one wiper Channel.A is mandatory for " + "parameter 'channel'"); } byte memAddr = channel.getNonVolatileMemoryAddress(); increaseOrDecrease(memAddr, locked, 1); } MicrochipPotentiometerDeviceController(final I2CDevice i2cDevice); DeviceControllerDeviceStatus getDeviceStatus(); void increase(final DeviceControllerChannel channel, final int steps); void decrease(final DeviceControllerChannel channel, final int steps); int getValue(final DeviceControllerChannel channel, final boolean nonVolatile); void setValue(final DeviceControllerChannel channel, final int value,
			final boolean nonVolatile); DeviceControllerTerminalConfiguration getTerminalConfiguration(
			final DeviceControllerChannel channel); void setTerminalConfiguration(final DeviceControllerTerminalConfiguration config); void setWiperLock(final DeviceControllerChannel channel,
			final boolean locked); void setWriteProtection(final boolean enabled); @Override String toString(); @Override boolean equals(final Object obj); static final boolean VOLATILE_WIPER; static final boolean NONVOLATILE_WIPER; }
@Test public void testSetWiperLock() throws IOException { try { controller.setWiperLock(null, true); fail("Got no RuntimeException on calling 'setWiperLock(null, ...)'!"); } catch (RuntimeException e) { } controller.setWiperLock(DeviceControllerChannel.A, true); verify(i2cDevice).write(new byte[] { (byte) 0b0100100 }, 0, 1); verify(i2cDevice).write(any(byte[].class), anyInt(), anyInt()); reset(i2cDevice); controller.setWiperLock(DeviceControllerChannel.A, false); verify(i2cDevice).write(new byte[] { (byte) 0b0101000 }, 0, 1); verify(i2cDevice).write(any(byte[].class), anyInt(), anyInt()); reset(i2cDevice); controller.setWiperLock(DeviceControllerChannel.B, true); verify(i2cDevice).write(new byte[] { (byte) 0b0110100 }, 0, 1); verify(i2cDevice).write(any(byte[].class), anyInt(), anyInt()); reset(i2cDevice); controller.setWiperLock(DeviceControllerChannel.B, false); verify(i2cDevice).write(new byte[] { (byte) 0b0111000 }, 0, 1); verify(i2cDevice).write(any(byte[].class), anyInt(), anyInt()); }