code: public void addRoadPath(S fromPosition, S toPosition, D roadPath) {
          final Transition<S> transition = new Transition<>(fromPosition, toPosition);
          if (roadPaths.containsKey(transition)) {
              throw new IllegalArgumentException("Transition has already been added.");
          }
          roadPaths.put(transition, roadPath);
      }
docs: Does not need to be called for non-existent transitions.