@Test
public void testInvalidInput() throws Exception {

    final String s = "stuff";
    final ReadableByteChannel channel = new ReadableByteChannelMock(
            new String[] {s}, StandardCharsets.US_ASCII);
    final SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, 0, StandardCharsets.US_ASCII);
    final BasicHttpTransportMetrics metrics = new BasicHttpTransportMetrics();
    final IdentityDecoder decoder = new IdentityDecoder(channel, inbuf, metrics);
    try {
        decoder.read(null);
        Assert.fail("NullPointerException should have been thrown");
    } catch (final NullPointerException ex) {
        // expected
    }
}