BluetoothSocketIoThread extends Thread { public BluetoothSocket getSocket() { return mSocket; } BluetoothSocketIoThread(BluetoothSocket socket, Listener listener); BluetoothSocket getSocket(); @Nullable PeerProperties getPeerProperties(); void setPeerProperties(PeerProperties peerProperties); void setExitThreadAfterRead(boolean exit); int getBufferSize(); void setBufferSize(int bufferSizeInBytes); @Override void run(); boolean write(byte[] bytes); synchronized void close(boolean closeStreams, boolean closeSocket);  }
@Test public void testGetSocket() throws Exception { assertThat("The socket is properly initialized", mBluetoothSocketIoThread.getSocket(), is(mMockBluetoothSocket)); }