MicrochipPotentiometerDeviceController { public void setWriteProtection(final boolean enabled) throws IOException { increaseOrDecrease(MEMADDR_WRITEPROTECTION, enabled, 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 testSetWriteProtection() throws IOException { controller.setWriteProtection(true); verify(i2cDevice).write(new byte[] { (byte) 0b11110100 }, 0, 1); verify(i2cDevice).write(any(byte[].class), anyInt(), anyInt()); reset(i2cDevice); controller.setWriteProtection(false); verify(i2cDevice).write(new byte[] { (byte) 0b11111000 }, 0, 1); verify(i2cDevice).write(any(byte[].class), anyInt(), anyInt()); }