Hi libu7alex,
ReadSerialTest throws a null pointer because TestSerialPortWrapper returns nulls for its input and output streams. That looks like a bug in the test, and shouldn't affect the larger issue you seem to be asking about, so,
I believe you're writing code to use Modbus4J? We offer limited free support for this.
You are providing the SerialPortWrapper to the Modbus master you're creating an instance of, correct? If so you should set a breakpoint in your serial port wrapper and see what happens in the serial library you're wrapping for the 232 setup you're testing when it tries to get the input or output stream from your wrapper.