docs: public void select(Segment segment, boolean addToSelection) {
      // abort if segment represents pairs inNone. Would select all segments...
      if(segment.isNone()) {
        return;
      }
      if(!addToSelection) {
        deselectAllSegments();
      }
  
      // get selected segments
      if(segment.isUnpaired()) {
        // check if all segments are selected
        if(addToSelection) {
          boolean allSegmentsSelected = true;
          for(Segment other : segments.getPairedSegments(segment)) {
            if(!isSelected(other)) {
              allSegmentsSelected = false;
              break;
            }
          }
  
          // if all are selected, deselect all
          if(allSegmentsSelected) {
            deselectSegment(segment);
            return;
          }
        }
        if(isSelected(segment)) {
          deselectSegment(segment);
        }
        else {
          selectSegment(segment);
        }
      }
      else {
        // an object segment was selected
        if(isSelected(segment)) {
          deselectSegment(segment);
        }
        else {
          selectSegment(segment);
        }
      }
    }