// Path: query/src/main/java/io/keen/client/java/exceptions/KeenQueryClientException.java
// public class KeenQueryClientException extends KeenException {
//     private static final long serialVersionUID = -8714276738565293346L;
// 
//     public KeenQueryClientException() {
//         super();
//     }
// 
//     public KeenQueryClientException(Throwable cause) {
//         super(cause);
//     }
// 
//     public KeenQueryClientException(String message) {
//         super(message);
//     }
// 
//     public KeenQueryClientException(String message, Throwable cause) {
//         super(message, cause);
//     }
// }


import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import io.keen.client.java.exceptions.KeenQueryClientException;

        // Validate step properties that cannot be true for the first funnel step
        FunnelStep firstStep = builder.steps.get(0);
        
        if (null != firstStep.getInverted() &&
            true == firstStep.getInverted()) {
            throw new IllegalArgumentException(
                "First step in funnel cannot have special parameter 'inverted' set to true.");
        }

        if (null != firstStep.getOptional() &&
            true == firstStep.getOptional()) {
            throw new IllegalArgumentException(
                "First step in funnel cannot have special parameter 'optional' set to true.");
        }

        // The steps in the Builder are ordered, so the request params will be too.
        this.steps = new RequestParameterCollection<FunnelStep>(builder.steps);
    }
    
    /**
     * Get the URL for this request.
     * 
     * @param urlBuilder The RequestUrlBuilder instance to use for building the URL.
     * @param projectId The projectId to use for the URL.
     * @return The URL for the request.
     * @throws KeenQueryClientException Thrown if there are errors formatting the URL.
     */
    @Override
    URL getRequestURL(RequestUrlBuilder urlBuilder, String projectId)
// Path: query/src/main/java/io/keen/client/java/exceptions/KeenQueryClientException.java
// public class KeenQueryClientException extends KeenException {
//     private static final long serialVersionUID = -8714276738565293346L;
// 
//     public KeenQueryClientException() {
//         super();
//     }
// 
//     public KeenQueryClientException(Throwable cause) {
//         super(cause);
//     }
// 
//     public KeenQueryClientException(String message) {
//         super(message);
//     }
// 
//     public KeenQueryClientException(String message, Throwable cause) {
//         super(message, cause);
//     }
// }


// Path: query/src/main/java/io/keen/client/java/Funnel.java
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import io.keen.client.java.exceptions.KeenQueryClientException;


        // Validate step properties that cannot be true for the first funnel step
        FunnelStep firstStep = builder.steps.get(0);
        
        if (null != firstStep.getInverted() &&
            true == firstStep.getInverted()) {
            throw new IllegalArgumentException(
                "First step in funnel cannot have special parameter 'inverted' set to true.");
        }

        if (null != firstStep.getOptional() &&
            true == firstStep.getOptional()) {
            throw new IllegalArgumentException(
                "First step in funnel cannot have special parameter 'optional' set to true.");
        }

        // The steps in the Builder are ordered, so the request params will be too.
        this.steps = new RequestParameterCollection<FunnelStep>(builder.steps);
    }
    
    /**
     * Get the URL for this request.
     * 
     * @param urlBuilder The RequestUrlBuilder instance to use for building the URL.
     * @param projectId The projectId to use for the URL.
     * @return The URL for the request.
     * @throws KeenQueryClientException Thrown if there are errors formatting the URL.
     */
    @Override
    URL getRequestURL(RequestUrlBuilder urlBuilder, String projectId)
            throws KeenQueryClientException {