#vulnerable code 
                              @Test
  public void certificateReadThrowsRuntimeException()
      throws ExecutionException, InterruptedException, IOException {
    MockTokenServerTransport transport = new MockTokenServerTransport();
    transport.addServiceAccount(ServiceAccount.EDITOR.getEmail(), ACCESS_TOKEN);

    InputStream inputStream =
        new InputStream() {
          @Override
          public int read() throws IOException {
            throw new IOException("Expected");
          }
        };

    FirebaseCredential credential =
        FirebaseCredentials.fromCertificate(inputStream, transport, Utils.getDefaultJsonFactory());

    try {
      Tasks.await(credential.getAccessToken(false));
      Assert.fail();
    } catch (Exception e) {
      Assert.assertEquals("java.io.IOException: Failed to read service account", e.getMessage());
      Assert.assertEquals("Expected", e.getCause().getCause().getMessage());
    }
  } 
                            #location 16 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                              @Test
  public void certificateReadThrowsRuntimeException()
      throws ExecutionException, InterruptedException {
    MockTokenServerTransport transport = new MockTokenServerTransport();
    transport.addServiceAccount(ServiceAccount.EDITOR.getEmail(), ACCESS_TOKEN);

    InputStream inputStream =
        new InputStream() {
          @Override
          public int read() throws IOException {
            throw new IOException("Expected");
          }
        };


    try {
      FirebaseCredentials.fromCertificate(inputStream, transport, Utils.getDefaultJsonFactory());
      Assert.fail();
    } catch (IOException e) {
      Assert.assertEquals("Expected", e.getMessage());
    }
  }