walkthroughs/week-5-tdd/project/src/main/java/com/google/sps/FindMeetingQuery.java
public List<Event> sortEvents(Collection<Event> events) {
      List<Event> newEvents = new ArrayList<>(events);
      
      List<TimeRange> sortedTimeRanges = new ArrayList<>();
      for (Event event : events) {
            sortedTimeRanges.add(event.getWhen());
      }

      Collections.sort(newEvents, Event.ORDER_BY_WHEN_START_TIME);
      Collections.sort(sortedTimeRanges, TimeRange.ORDER_BY_START);
        
      return newEvents;
  }
/**
   * This method sorts the event objects in ascending order of the start time
   * of the events when attribute (TimeRange object)
   * @param events It contains a collection of event objects
   * @return List<Events> sorted version of the events parameter passed.
   */
This method sorts the event objects in ascending order of the start time
of the events when attribute (TimeRange object)
@param events It contains a collection of event objects
@return List sorted version of the events parameter passed.
This method sorts the event objects in ascending order of the start time of the events when attribute ( TimeRange object ) @param events It contains a collection of event objects @return List sorted version of the events parameter passed .
public List<Event> sortEvents(Collection<Event> events) {
      List<Event> newEvents = new ArrayList<>(events);
      List<TimeRange> sortedTimeRanges = new ArrayList<>();
      for (Event event : events) {
            sortedTimeRanges.add(event.getWhen());
      }
      Collections.sort(newEvents, Event.ORDER_BY_WHEN_START_TIME);
      Collections.sort(sortedTimeRanges, TimeRange.ORDER_BY_START);
      return newEvents;
  }
public List < Event > sortEvents ( Collection < Event > events ) { List < Event > newEvents = new ArrayList < > ( events ) ; List < TimeRange > sortedTimeRanges = new ArrayList < > ( ) ; for ( Event event : events ) { sortedTimeRanges . add ( event . getWhen ( ) ) ; } Collections . sort ( newEvents , Event . ORDER_BY_WHEN_START_TIME ) ; Collections . sort ( sortedTimeRanges , TimeRange . ORDER_BY_START ) ; return newEvents ; }
This method sorts the event objects in ascending order of the start time
 of the events when attribute (TimeRange object)
 @param events It contains a collection of event objects
 @return List<Events> sorted version of the events parameter passed.
This method sorts the event objects in ascending order of the start time of the events when attribute ( TimeRange object ) @param events It contains a collection of event objects @return List<Events > sorted version of the events parameter passed .