class VulnDbClient {

    private final String consumerKey;
    private final String consumerSecret;

    private final String apiBaseUrl;


    public VulnDbClient(String consumerKey, String consumerSecret, String apiBaseUrl) {
        this.consumerKey = consumerKey;
        this.consumerSecret = consumerSecret;
        this.apiBaseUrl = apiBaseUrl;
    }

    private static final Logger LOGGER = LoggerFactory.getLogger(VulnDbClient.class);

    public Results getVulnerabilitiesByCpe(String cpe, int size, int page) throws IOException, OAuthMessageSignerException, OAuthExpectationFailedException, URISyntaxException, OAuthCommunicationException {
        String encodedCpe = cpe;

        try {
            encodedCpe = URLEncoder.encode(cpe, StandardCharsets.UTF_8.name());
        } catch (UnsupportedEncodingException var6) {
            LOGGER.warn("An error occurred while URL encoding a CPE", var6);
            throw new UnsupportedEncodingException();
        }

        return this.getResults(apiBaseUrl + "/api/v1/vulnerabilities/find_by_cpe?&cpe=" + encodedCpe, Vulnerability.class, size, page);
    }

    private Results getResults(String url, Class clazz, int size, int page) throws IOException,
            OAuthMessageSignerException, OAuthExpectationFailedException, URISyntaxException,
            OAuthCommunicationException {<FILL_FUNCTION_BODY>}

    private CloseableHttpResponse makeRequest(String url) throws OAuthMessageSignerException, OAuthExpectationFailedException, IOException, URISyntaxException, OAuthCommunicationException {
        OAuthConsumer consumer = new DefaultOAuthConsumer(this.consumerKey, this.consumerSecret);
        String signed = consumer.sign(url);
        URIBuilder uriBuilder = new URIBuilder(signed);
        HttpGet request = new HttpGet(uriBuilder.build().toString());
        request.addHeader("X-User-Agent", "Dependency Track (https://github.com/DependencyTrack/dependency-track)");
        return HttpClientPool.getClient().execute(request);
    }

    private void logHttpResponseError(CloseableHttpResponse response) {
        LOGGER.error("Response was not successful: " + response.getStatusLine().getStatusCode() + " - " + response.getStatusLine().getReasonPhrase());
    }
}

        String modifiedUrl = url.contains("?") ? url + "&" : url + "?";
        try (CloseableHttpResponse response = this.makeRequest(modifiedUrl + "size=" + size + "&page=" + page)) {
            VulnDbParser vulnDbParser = new VulnDbParser();
            Results results;
            if (response != null) {
                if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
                    String responseString = EntityUtils.toString(response.getEntity());
                    var jsonObject = new JSONObject(responseString);
                    results = vulnDbParser.parse(jsonObject, clazz);
                    return results;
                } else {
                    results = new Results();
                    results.setErrorCondition("An unexpected response was returned from VulnDB. Request unsuccessful: " + response.getStatusLine().getStatusCode() + " - " + response.getStatusLine().getReasonPhrase());
                    this.logHttpResponseError(response);
                    return results;
                }
            } else {
                results = new Results();
                results.setErrorCondition("No response was returned from VulnDB. No further information is available.");
                return results;
            }
        }
    
<no_super_class>