code: public static TraceEventStatus mergeStatus(Collection<TraceEventStatus> data)
     {
        TraceEventStatus result = TraceEventStatus.GREEN;
  
        for (TraceEventStatus tes : data)
        {
           if (tes == TraceEventStatus.YELLOW)
           {
              result = TraceEventStatus.YELLOW;
           }
           else if (tes == TraceEventStatus.RED)
           {
              return TraceEventStatus.RED;
           }
        }
  
        return result;
     }
docs: Get status
  @param data The data
  @return The status