private static Function<byte[], List<Endpoint>> responseConverter(
            RequestHeadersBuilder builder, @Nullable String appName, @Nullable String instanceId,
            @Nullable String vipAddress, @Nullable String secureVipAddress, @Nullable List<String> regions) {
        if (regions != null) {
            final Predicate<InstanceInfo> filter;
            final String path;
            boolean secureVip = false;
            if (vipAddress != null) {
                path = VIPS + vipAddress;
                filter = instanceInfo -> vipAddress.equals(instanceInfo.getVipAddress());
            } else if (secureVipAddress != null) {
                secureVip = true;
                path = SVIPS + secureVipAddress;
                filter = instanceInfo -> secureVipAddress.equals(instanceInfo.getSecureVipAddress());
            } else {
                // If regions is specified, we fetch all registry information and filter what we need because
                // some of the REST endpoints do not support regions query parameter.
                path = APPS;
                if (appName == null && instanceId == null) {
                    filter = allInstances;
                } else if (appName != null && instanceId != null) {
                    filter = instanceInfo -> appName.equals(instanceInfo.getAppName()) &&
                                             instanceId.equals(instanceInfo.getInstanceId());
                } else if (appName != null) {
                    filter = instanceInfo -> appName.equals(instanceInfo.getAppName());
                } else {
                    filter = instanceInfo -> Objects.equals(instanceId, instanceInfo.getInstanceId());
                }
            }
            final StringJoiner joiner = new StringJoiner(",");
            regions.forEach(joiner::add);
            final QueryParams queryParams = QueryParams.of("regions", joiner.toString());
            builder.path(path + '?' + queryParams.toQueryString());
            return new ApplicationsConverter(filter, secureVip);
        }

        if (vipAddress != null) {
            builder.path(VIPS + vipAddress);
            return new ApplicationsConverter();
        }

        if (secureVipAddress != null) {
            builder.path(SVIPS + secureVipAddress);
            return new ApplicationsConverter(allInstances, true);
        }

        if (appName == null && instanceId == null) {
            builder.path(APPS);
            return new ApplicationsConverter();
        }

        if (appName != null && instanceId != null) {
            builder.path(APPS + '/' + appName + '/' + instanceId);
            return new InstanceInfoConverter();
        }

        if (appName != null) {
            builder.path(APPS + '/' + appName);
            return new ApplicationConverter();
        }

        // instanceId is not null at this point.
        builder.path(INSTANCES + instanceId);
        return new InstanceInfoConverter();
    }
Returns a new {@link EurekaEndpointGroupBuilder} created with the specified {@link HttpPreprocessor}
and path.
eureka/src/main/java/com/linecorp/armeria/client/eureka/EurekaEndpointGroup.java