@Test(expected = IllegalStateException.class)
public void shouldNotAllowHeadersToBeFlushedTwice() throws IOException {

    try {
        httpServletResponseImpl.flushHeaders();
    } catch (IllegalStateException e) {
        fail("Should not throw exception on the first call");
    }
    httpServletResponseImpl.flushHeaders();
}