ChipJavaPinCommand implements PinCommand { @Override public void write(Pin pin, boolean value) throws PinCommandException { try { FileStreams.writeFile(new File(Commands.WRITE.command(pin)), value ? "1" : "0"); } catch (IOException e) { throw new PinCommandException(e); } }  @Override Pin.Mode getMode(Pin pin); @Override void setMode(Pin pin, Pin.Mode mode); @Override void enable(Pin pin); @Override void disable(Pin pin); @Override boolean read(Pin pin); @Override void write(Pin pin, boolean value); @Override File path(Pin pin);  }
@Test public void testWrite() throws Exception { try { ChipJavaPinCommand cmd = new ChipJavaPinCommand(); cmd.write(getPin(), false); assert true; } catch (PinCommandException e) { dealWithException(e); } }