#vulnerable code 
                                @Test
    public void testRestoreChallenge() throws AcmeException {
        Connection connection = new DummyConnection() {
            @Override
            public int sendRequest(URI uri) throws AcmeException {
                assertThat(uri, is(locationUri));
                return HttpURLConnection.HTTP_ACCEPTED;
            }

            @Override
            public Map<String, Object> readJsonResponse() throws AcmeException {
                return getJsonAsMap("updateHttpChallengeResponse");
            }
        };

        TestableAbstractAcmeClient client = new TestableAbstractAcmeClient(connection);
        client.putTestChallenge(Http01Challenge.TYPE, new Http01Challenge());

        Challenge challenge = client.restoreChallenge(locationUri);

        assertThat(challenge.getStatus(), is(Status.VALID));
        assertThat(challenge.getLocation(), is(locationUri));
    } 
                            #location 19 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                @Test
    public void testRestoreChallenge() throws AcmeException {
        Connection connection = new DummyConnection() {
            @Override
            public int sendRequest(URI uri) {
                assertThat(uri, is(locationUri));
                return HttpURLConnection.HTTP_ACCEPTED;
            }

            @Override
            public Map<String, Object> readJsonResponse() {
                return getJsonAsMap("updateHttpChallengeResponse");
            }
        };

        TestableAbstractAcmeClient client = new TestableAbstractAcmeClient(connection);
        client.putTestChallenge(Http01Challenge.TYPE, new Http01Challenge());

        Challenge challenge = client.restoreChallenge(locationUri);

        assertThat(challenge.getStatus(), is(Status.VALID));
        assertThat(challenge.getLocation(), is(locationUri));
    }