ChipSystemPinCommand implements PinCommand { public static void led(boolean on) throws PinCommandException { try { if (on) RuntimeCommandExec.exec(Commands.LED_ON.command()); else RuntimeCommandExec.exec(Commands.LED_OFF.command()); } catch (RuntimeCommandException 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); static void led(boolean on);  }
@Test public void testLed() throws Exception { try { ChipSystemPinCommand.led(true); } catch (PinCommandException e) { dealWithException(e); } try { ChipSystemPinCommand.led(false); } catch (PinCommandException e) { dealWithException(e); } }