// Path: url/src/main/java/com/danisola/restify/url/RestUrl.java
// public class RestUrl {
// 
//     final String errorMessage;
//     final VarType[] types;
//     final Object[] values;
// 
//     static RestUrl invalidRestUrl(String errorMsg) {
//         return new RestUrl(null, null, errorMsg);
//     }
// 
//     static RestUrl restUrl(VarType[] types, Object[] values) {
//         return new RestUrl(types, values, null);
//     }
// 
//     private RestUrl(VarType[] types, Object[] values, String errorMsg) {
//         this.types = types;
//         this.values = values;
//         this.errorMessage = errorMsg;
//     }
// 
//     /**
//      * Returns true if it matches the pattern and variable types of the {@link RestParser} that has generated this
//      * {@link RestUrl}.
//      */
//     public boolean isValid() {
//         return errorMessage == null;
//     }
// 
//     /**
//      * <p>If {@link #isValid()} is false, returns a message explaining why the parsed URL did not match the pattern
//      * and variables of the {@link RestParser} that has generated this {@link RestUrl}.</p>
//      *
//      * <p>If {@link #isValid()} is true, returns null</p>
//      */
//     public String errorMessage() {
//         return errorMessage;
//     }
// 
//     /**
//      * Returns the given variable with the specified return type. The variable id and type must match the declared
//      * ones in the {@link RestParser} that has generated this {@link RestUrl}.
//      *
//      * <p>This method throws exceptions to enforce a correct usage of the API.</p>
//      *
//      * @throws IllegalArgumentException if variableId is null, empty or not defined in the {@link RestParser}
//      * @throws IllegalStateException if the URL is invalid ({@link #isValid()} is false)
//      * @throws ClassCastException if the returned variable has not the same type as the declared variable in {@link RestParser}
//      */
//     public <T> T variable(String variableId) {
//         checkArgumentNotNullOrEmpty(variableId);
//         checkState(isValid(), "Variables are not accessible for invalid URLs");
// 
//         for (int i = 0; i < types.length; i++) {
//             if (types[i].getId().equals(variableId)) {
//                 return (T) values[i];
//             }
//         }
//         throw new IllegalArgumentException("Variable id '" + variableId + "' is not declared in the pattern");
//     }
// }
// 
// Path: url/src/main/java/com/danisola/restify/url/types/VarType.java
// public interface VarType<T> {
// 
//     public String getId();
// 
//     public String getVarPattern();
// 
//     public T convert(String value) throws Exception;
// }


import com.danisola.restify.servlet.*;
import com.danisola.restify.url.RestUrl;
import com.danisola.restify.url.types.VarType;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
package com.danisola.restify.servlet.utils;



public class TestServlet extends RestServlet implements Delete, Get, Head, Options, Post, Put, Trace {

    private final TestCallback callback;

// Path: url/src/main/java/com/danisola/restify/url/RestUrl.java
// public class RestUrl {
// 
//     final String errorMessage;
//     final VarType[] types;
//     final Object[] values;
// 
//     static RestUrl invalidRestUrl(String errorMsg) {
//         return new RestUrl(null, null, errorMsg);
//     }
// 
//     static RestUrl restUrl(VarType[] types, Object[] values) {
//         return new RestUrl(types, values, null);
//     }
// 
//     private RestUrl(VarType[] types, Object[] values, String errorMsg) {
//         this.types = types;
//         this.values = values;
//         this.errorMessage = errorMsg;
//     }
// 
//     /**
//      * Returns true if it matches the pattern and variable types of the {@link RestParser} that has generated this
//      * {@link RestUrl}.
//      */
//     public boolean isValid() {
//         return errorMessage == null;
//     }
// 
//     /**
//      * <p>If {@link #isValid()} is false, returns a message explaining why the parsed URL did not match the pattern
//      * and variables of the {@link RestParser} that has generated this {@link RestUrl}.</p>
//      *
//      * <p>If {@link #isValid()} is true, returns null</p>
//      */
//     public String errorMessage() {
//         return errorMessage;
//     }
// 
//     /**
//      * Returns the given variable with the specified return type. The variable id and type must match the declared
//      * ones in the {@link RestParser} that has generated this {@link RestUrl}.
//      *
//      * <p>This method throws exceptions to enforce a correct usage of the API.</p>
//      *
//      * @throws IllegalArgumentException if variableId is null, empty or not defined in the {@link RestParser}
//      * @throws IllegalStateException if the URL is invalid ({@link #isValid()} is false)
//      * @throws ClassCastException if the returned variable has not the same type as the declared variable in {@link RestParser}
//      */
//     public <T> T variable(String variableId) {
//         checkArgumentNotNullOrEmpty(variableId);
//         checkState(isValid(), "Variables are not accessible for invalid URLs");
// 
//         for (int i = 0; i < types.length; i++) {
//             if (types[i].getId().equals(variableId)) {
//                 return (T) values[i];
//             }
//         }
//         throw new IllegalArgumentException("Variable id '" + variableId + "' is not declared in the pattern");
//     }
// }
// 
// Path: url/src/main/java/com/danisola/restify/url/types/VarType.java
// public interface VarType<T> {
// 
//     public String getId();
// 
//     public String getVarPattern();
// 
//     public T convert(String value) throws Exception;
// }


// Path: servlet/src/test/java/com/danisola/restify/servlet/utils/TestServlet.java
import com.danisola.restify.servlet.*;
import com.danisola.restify.url.RestUrl;
import com.danisola.restify.url.types.VarType;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

package com.danisola.restify.servlet.utils;



public class TestServlet extends RestServlet implements Delete, Get, Head, Options, Post, Put, Trace {

    private final TestCallback callback;

    public TestServlet(TestCallback callback, String pattern, VarType... types) {