public Transition setOutgoingTransitionInput(Transition t, ArrayList<String> input) throws NoSuchTransitionException, Exception{
        if(outgoingTransitions.contains(t)) {
            t.setInput(null);
            for(String label:input) {
                addLabelToOutgoingTransition(t, label);
            }
            return t;
        } else {
            Transition existing = getExistingOutgoingTransition(t);
            if(existing != null) {
                //merge
                for(String c:input)
                    addLabelToOutgoingTransition(existing, c);
                return existing;
            } else {
                throw new NoSuchTransitionException();
            }
        }
    }