public State getTargetState(String input) {
        if(input != null) {
            for(Transition t:outgoingTransitions) {
                if(t.getInput().contains(input))
                    return t.getToState();
            }
        }
        return null;
    }