public Transition addOutgoingTransition(Transition t, boolean consistency) throws Exception{
        //check if there is not yet another transition with the same target state
        Transition existing = getExistingOutgoingTransition(t);

        if(existing != null) {
            //merge
            return mergeOutgoingTransitions(existing, t);
        }
        //check if there is not yet another transition with the same label
        if(!outgoingTransitions.contains(t)) {
            if(t.getInput().size() == 0 || !consistency) {
                outgoingTransitions.add(t);
                t.getToState().addIncomingTransition(t);
            } else {
                ArrayList<String> input = t.getInput();
                t.setInput(new ArrayList<String>());
                outgoingTransitions.add(t);
                t.getToState().addIncomingTransition(t);
                for(String s:input) {
                    try{
                        addLabelToOutgoingTransition(t, s);
                    } catch(Exception ex) {
                        outgoingTransitions.remove(t);
                        throw ex;
                    }
                }
            }
            return t;
        } else {
            String from = t.getFromState().getState_Properties().getName();
            String to = t.getToState().getState_Properties().getName();
            throw new Exception("Trying to add transition from "+from+" to "+to+" but there is already a transition!");
        }
    }