// Path: src/main/java/net/redborder/cep/rest/exceptions/RestException.java
// public class RestException extends Exception {
//     public RestException(String message) {
//         super(message);
//     }
// 
//     public RestException(String message, Throwable cause) {
//         super(message, cause);
//     }
// }
// 
// Path: src/main/java/net/redborder/cep/rest/exceptions/RestInvalidException.java
// public class RestInvalidException extends RestException {
//     public RestInvalidException(String message) {
//         super(message);
//     }
// 
//     public RestInvalidException(String message, Throwable cause) {
//         super(message, cause);
//     }
// }
// 
// Path: src/main/java/net/redborder/cep/rest/exceptions/RestNotFoundException.java
// public class RestNotFoundException extends RestException {
//     public RestNotFoundException(String message) {
//         super(message);
//     }
// 
//     public RestNotFoundException(String message, Throwable cause) {
//         super(message, cause);
//     }
// }


import net.redborder.cep.rest.exceptions.RestException;
import net.redborder.cep.rest.exceptions.RestInvalidException;
import net.redborder.cep.rest.exceptions.RestNotFoundException;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.codehaus.jackson.map.ObjectMapper;
import javax.inject.Singleton;
import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
        return response;
    }

    // Helper methods

    /**
     * This method returns a map from a given json string
     *
     * @param str The JSON string to parse
     * @return A map with the JSON contents
     * @throws RestException If the string does not have a valid JSON format
     */

    private Map<String, Object> parseMap(String str) throws RestException {
        try {
            Map<String, Object> result = mapper.readValue(str, Map.class);
            return result;
        } catch (IOException e) {
            throw new RestInvalidException("couldn't parse json", e);
        }
    }

    /**
     * This method returns a list from a given json string
     *
     * @param str The JSON string to parse
     * @return A list with the JSON contents
     * @throws RestException If the string does not have a valid JSON format
     */

// Path: src/main/java/net/redborder/cep/rest/exceptions/RestException.java
// public class RestException extends Exception {
//     public RestException(String message) {
//         super(message);
//     }
// 
//     public RestException(String message, Throwable cause) {
//         super(message, cause);
//     }
// }
// 
// Path: src/main/java/net/redborder/cep/rest/exceptions/RestInvalidException.java
// public class RestInvalidException extends RestException {
//     public RestInvalidException(String message) {
//         super(message);
//     }
// 
//     public RestInvalidException(String message, Throwable cause) {
//         super(message, cause);
//     }
// }
// 
// Path: src/main/java/net/redborder/cep/rest/exceptions/RestNotFoundException.java
// public class RestNotFoundException extends RestException {
//     public RestNotFoundException(String message) {
//         super(message);
//     }
// 
//     public RestNotFoundException(String message, Throwable cause) {
//         super(message, cause);
//     }
// }


// Path: src/main/java/net/redborder/cep/rest/RestRules.java
import net.redborder.cep.rest.exceptions.RestException;
import net.redborder.cep.rest.exceptions.RestInvalidException;
import net.redborder.cep.rest.exceptions.RestNotFoundException;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.codehaus.jackson.map.ObjectMapper;
import javax.inject.Singleton;
import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

        return response;
    }

    // Helper methods

    /**
     * This method returns a map from a given json string
     *
     * @param str The JSON string to parse
     * @return A map with the JSON contents
     * @throws RestException If the string does not have a valid JSON format
     */

    private Map<String, Object> parseMap(String str) throws RestException {
        try {
            Map<String, Object> result = mapper.readValue(str, Map.class);
            return result;
        } catch (IOException e) {
            throw new RestInvalidException("couldn't parse json", e);
        }
    }

    /**
     * This method returns a list from a given json string
     *
     * @param str The JSON string to parse
     * @return A list with the JSON contents
     * @throws RestException If the string does not have a valid JSON format
     */

    private List<Map<String, Object>> parseList(String str) throws RestException {