PinManager { public Pin getPin(String code) throws PinException { if (pins.containsKey(code)) return pins.get(code); else throw new PinException("Pin is not created. Please call 'createPin' first."); } private  PinManager(BoardType boardType); Class<ChipPinCode> getPinCodeClass(); static PinManager getInstance(); Pin createPin(PinCode pinCode, Pin.Mode mode); Pin getPin(String code);  }
@Test public void testGetPin() throws Exception { try { Pin pin = PinManager.getInstance().getPin("XIO_P0"); assert pin != null; } catch (PinException e) { assert e.getMessage().equals("Pin is not created. Please call 'createPin' first."); } }