### Question:
BufferDrainer { public StringBuffer getErrorBuffer() { if (drainBuffersFinished) { return errorBuffer; } else { throw new IllegalStateException("Buffer draining has not been finished yet"); } } BufferDrainer(Process process, int maxLength); int drainBuffers(); StringBuffer getInputBuffer(); StringBuffer getErrorBuffer();  }### Answer:
@Test public void testTooEarlyErrorStreamRead() { final BufferDrainer bufferDrainer = new BufferDrainer(null, 0); expectedException.expect(IllegalStateException.class); bufferDrainer.getErrorBuffer(); }