ChipJavaPinCommand implements PinCommand { @Override public Pin.Mode getMode(Pin pin) throws PinCommandException { try { String result = FileStreams.readFile(new File(Commands.MODE.command(pin))); return Pin.Mode.valueOf(result.toUpperCase(Locale.ENGLISH)); } 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 testGetMode() throws Exception { try { ChipJavaPinCommand cmd = new ChipJavaPinCommand(); cmd.getMode(getPin()); } catch (PinCommandException e) { dealWithException(e); } }