RpcInputStream extends FileInputStream { @Override public void close() throws IOException { if (this.lineEndStream != null) { this.lineEndStream.close(); } super.close(); } RpcInputStream(RpcPerforceFile file, Charset fromCharset); @Override void close(); @Override int read(); @Override int read(byte[] targetBytes, int targetOffset, int targetLen); @Override int read(byte[] targetBytes);  }
@Test(expected = NullPointerException.class) public void testConstructor_with_null_file() throws IOException, FileEncoderException { RpcInputStream stream = new RpcInputStream(null, null); stream.close(); }