### Question:
NoClosePipedInputStream extends InputStream { protected synchronized void receive(int b) throws IOException { checkStateForReceive(); writeSide = Thread.currentThread(); if (in == out) awaitSpace(); if (in < 0) { in = 0; out = 0; } buffer[in++] = (byte)(b & 0xFF); if (in >= buffer.length) { in = 0; } } NoClosePipedInputStream(NoClosePipedOutputStream src);  NoClosePipedInputStream(NoClosePipedOutputStream src, int pipeSize);  NoClosePipedInputStream();  NoClosePipedInputStream(int pipeSize); void connect(NoClosePipedOutputStream src); synchronized int read(); synchronized int read(byte b[], int off, int len); synchronized int available();  }### Answer:
@Test public void testNotConnectedPipesIntReceive() { try{ in.receive(1); fail("This test should have thrown an IOException already"); } catch (IOException e) { assertEquals("Pipe not connected", e.getMessage()); return; } fail("This test should have thrown a IOException due to not connected pipes"); }