Let\'s say Java has two kind of sockets:
Imagine the situation of two
Are you trying to created a mocked socket ? If so, mocking both sides of the pipe may be a bit more complicated than necessary.
On the other hand, if you just want to create a data pipe between two threads, you could use PipedInputStream and PipedOutputStream.
However, without more information about what your trying to accomplish, I cannot tell you if either of these choices is a good fit or if something else would be better.