// Path: cas-core/src/main/java/com/ghjansen/cas/core/exception/InvalidCombinationException.java
// public class InvalidCombinationException extends Exception {
// 
//     /**
//      * Serialization management
//      */
//     private static final long serialVersionUID = 884762124844706448L;
// 
// }
// 
// Path: cas-core/src/main/java/com/ghjansen/cas/core/exception/InvalidStateException.java
// public class InvalidStateException extends Exception {
// 
//     /**
//      * Serialization management
//      */
//     private static final long serialVersionUID = -7435119307025647318L;
// 
// }
// 
// Path: cas-core/src/main/java/com/ghjansen/cas/core/exception/InvalidTransitionException.java
// public class InvalidTransitionException extends Exception {
// 
//     /**
//      * Serialization management
//      */
//     private static final long serialVersionUID = 1848434169756515614L;
// 
// }


import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.ghjansen.cas.core.exception.InvalidCombinationException;
import com.ghjansen.cas.core.exception.InvalidStateException;
import com.ghjansen.cas.core.exception.InvalidTransitionException;
            if (this.transitions.containsKey(s)) {
                this.transitions.get(s).add(t);
            } else {
                ArrayList<N> l = new ArrayList<N>();
                l.add(t);
                this.transitions.put(s, l);
            }
        }
    }

    public N getTransition(O combination) throws InvalidStateException, InvalidCombinationException {
        A s = (A) combination.getReferenceState();
        List<N> l = this.transitions.get(s);
        if (l == null) {
            throw new InvalidStateException();
        }
        for (N t : l) {
            boolean found = true;
            for (int i = 0; i < combination.getNeighborhood().size(); i++) {
                A neighborCombination = (A) combination.getNeighborhood().get(i);
                A neighborTransition = (A) t.getCombination().getNeighborhood().get(i);
                if (!neighborCombination.equals(neighborTransition)) {
                    found = false;
                    break;
                }
            }
            if (found) {
                return t;
            }
        }
// Path: cas-core/src/main/java/com/ghjansen/cas/core/exception/InvalidCombinationException.java
// public class InvalidCombinationException extends Exception {
// 
//     /**
//      * Serialization management
//      */
//     private static final long serialVersionUID = 884762124844706448L;
// 
// }
// 
// Path: cas-core/src/main/java/com/ghjansen/cas/core/exception/InvalidStateException.java
// public class InvalidStateException extends Exception {
// 
//     /**
//      * Serialization management
//      */
//     private static final long serialVersionUID = -7435119307025647318L;
// 
// }
// 
// Path: cas-core/src/main/java/com/ghjansen/cas/core/exception/InvalidTransitionException.java
// public class InvalidTransitionException extends Exception {
// 
//     /**
//      * Serialization management
//      */
//     private static final long serialVersionUID = 1848434169756515614L;
// 
// }


// Path: cas-core/src/main/java/com/ghjansen/cas/core/ca/Rule.java
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.ghjansen.cas.core.exception.InvalidCombinationException;
import com.ghjansen.cas.core.exception.InvalidStateException;
import com.ghjansen.cas.core.exception.InvalidTransitionException;

            if (this.transitions.containsKey(s)) {
                this.transitions.get(s).add(t);
            } else {
                ArrayList<N> l = new ArrayList<N>();
                l.add(t);
                this.transitions.put(s, l);
            }
        }
    }

    public N getTransition(O combination) throws InvalidStateException, InvalidCombinationException {
        A s = (A) combination.getReferenceState();
        List<N> l = this.transitions.get(s);
        if (l == null) {
            throw new InvalidStateException();
        }
        for (N t : l) {
            boolean found = true;
            for (int i = 0; i < combination.getNeighborhood().size(); i++) {
                A neighborCombination = (A) combination.getNeighborhood().get(i);
                A neighborTransition = (A) t.getCombination().getNeighborhood().get(i);
                if (!neighborCombination.equals(neighborTransition)) {
                    found = false;
                    break;
                }
            }
            if (found) {
                return t;
            }
        }
        throw new InvalidCombinationException();