@Test
public void testCloseStreams() throws IOException {

  File tmpFile = null;
  FileOutputStream fos;
  BufferedOutputStream bos;
  FileOutputStream nullStream = null;
  try {
    tmpFile = new File(GenericTestUtils.getTestDir(), "testCloseStreams.txt");
    fos = new FileOutputStream(tmpFile) {
      @Override
      public void close() throws IOException {
        throw new IOException();
      }
    };
    bos = new BufferedOutputStream(
        new FileOutputStream(tmpFile)) {
      @Override
      public void close() {
        throw new NullPointerException();
      }
    };
    IOUtils.closeStreams(fos, bos, nullStream);
    IOUtils.closeStreams();
  } finally {
    FileUtils.deleteQuietly(tmpFile);
  }
}