### Question:
AbstractSerialPort implements IConnectionInterface { @Override public boolean isOpen() { return connectionOpen; } protected  AbstractSerialPort(String port, SerialPortParameters parameters); protected  AbstractSerialPort(String port, int baudRate); protected  AbstractSerialPort(String port, int baudRate, int receiveTimeout); protected  AbstractSerialPort(String port, SerialPortParameters parameters, int receiveTimeout); @Override boolean isOpen(); String getPort(); abstract void setDTR(boolean state); abstract void setRTS(boolean state); abstract boolean isCTS(); abstract boolean isDSR(); abstract boolean isCD(); boolean isHardwareFlowControl(); void setPortParameters(int baudRate, int dataBits, int stopBits, int parity, int flowControl); void setPortParameters(SerialPortParameters parameters); abstract void setBreak(boolean enabled); abstract void sendBreak(int duration); abstract void setReadTimeout(int timeout); abstract int getReadTimeout(); void purge(); void flush(); @Override void writeData(byte[] data); @Override void writeData(byte[] data, int offset, int length); @Override int readData(byte[] data); @Override int readData(byte[] data, int offset, int length); @Override ConnectionType getConnectionType(); SerialPortParameters getPortParameters(); int getReceiveTimeout(); @Override String toString(); static final int DEFAULT_PORT_TIMEOUT; static final int DEFAULT_DATA_BITS; static final int DEFAULT_STOP_BITS; static final int DEFAULT_PARITY; static final int DEFAULT_FLOW_CONTROL; }### Answer:
@Test public final void testIsOpenNoOpened() { TestAbstractSerialPort port = new TestAbstractSerialPort("COM1", 9600); boolean isOpen = port.isOpen(); assertThat(isOpen, is(equalTo(false))); }
@Test public final void testIsOpenAfterOpening() { TestAbstractSerialPort port = new TestAbstractSerialPort("COM1", 9600); port.connectionOpen = true; boolean isOpen = port.isOpen(); assertThat(isOpen, is(equalTo(true))); }