boolean added = uniqueTrafficLightIdsInRoads.add(signal.getId());
if (!added) {
throw new IllegalArgumentException("trafficlight signal with id=" + signal.getId()
+ " is not unique in xodr network definition.");
}
Controller controller = signalIdsToController.get(signal.getId());
if (controller == null) {
throw new IllegalArgumentException("trafficlight signal with id=" + signal.getId()
+ " is not referenced in xodr <controller> definition.");
}
roadSegment.addTrafficLightLocation(new TrafficLightLocation(signal, controller));