public boolean isSelected(Segment segment){
  return selectedSegments.contains(segment) || indirectSelections.containsValue(segment);
}

public boolean isSelected ( Segment segment ) { return selectedSegments . contains ( segment ) || indirectSelections . containsValue ( segment ) ; }
test whether a segment is selected .
