private URI makeURI(final String service, final Map<String, String> parameters) {
        try {
            StringBuilder queryStringBuilder = new StringBuilder();
            if (apiBaseUri.getQuery() != null) {
                queryStringBuilder.append(apiBaseUri.getQuery()).append("&");
            }
            queryStringBuilder.append("srv=").append(service);
            for (Map.Entry<String, String> entry: parameters.entrySet()) {
                queryStringBuilder.append("&").append(entry.getKey()).append("=").append(entry.getValue());
            }
            return new URI(apiBaseUri.getScheme(), apiBaseUri.getAuthority(), apiBaseUri.getPath(),
                    queryStringBuilder.toString(), apiBaseUri.getFragment());
        } catch (URISyntaxException e) {
            // This shouldn't happen, but needs to be caught regardless.
            throw new AssertionError("Could not construct API URI", e);
        }
    }
private URI makeURI ( final String service , final Map < String , String > parameters ) { try { StringBuilder queryStringBuilder = new StringBuilder ( ) ; if ( apiBaseUri . getQuery ( ) != null ) { queryStringBuilder . append ( apiBaseUri . getQuery ( ) ) . append ( "&" ) ; } queryStringBuilder . append ( "srv=" ) . append ( service ) ; for ( Map . Entry < String , String > entry : parameters . entrySet ( ) ) { queryStringBuilder . append ( "&" ) . append ( entry . getKey ( ) ) . append ( "=" ) . append ( entry . getValue ( ) ) ; } return new URI ( apiBaseUri . getScheme ( ) , apiBaseUri . getAuthority ( ) , apiBaseUri . getPath ( ) , queryStringBuilder . toString ( ) , apiBaseUri . getFragment ( ) ) ; } catch ( URISyntaxException e ) { throw new AssertionError ( "Could not construct API URI" , e ) ; } }
Build the URI for a particular service call.

@param service The CCB API service to call (i.e. the srv query parameter).
@param parameters A map of query parameters to include on the URI.
@return The apiBaseUri with the additional query parameters appended.