// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.sps.data;

import java.util.ArrayList;

/**
 * A class to make a Trip type, containing
 * a specific id, destinations, interests and routes 
 * to be used when updating a trip.
 */
public final class Trip {

  private String id;
  private String start;
  private ArrayList<String> destinations;
  private ArrayList<String> interests;
  private ArrayList<String> route;

  public Trip(String id, String start, ArrayList<String> destinations,
              ArrayList<String> interests, ArrayList<String> route) {
    this.id = id;
    this.start = start;
    this.destinations = destinations;
    this.interests = interests;
    this.route = route;
  }

  public ArrayList<String> getInterests() {
      return this.interests;
  }

  public ArrayList<String> getRoute() {
      return this.route;
  }

  public ArrayList<String> getDestinations() {
    return this.destinations;
  }

  public String getTripId() {
      return this.id;
  }

  public String getStart() {
      return this.start;
  }
} 
@@ -639,16 +639,81 @@
 rayList;
+%0Aimport static com.google.common.base.Preconditions.checkNotNull;
 %0A%0A/**%0A *
@@ -880,24 +880,30 @@
 %0A%0A  private 
+final 
 String id;%0A 
@@ -911,16 +911,22 @@
 private 
+final 
 String s
@@ -933,32 +933,38 @@
 tart;%0A  private 
+final 
 ArrayList%3CString
@@ -981,32 +981,38 @@
 ions;%0A  private 
+final 
 ArrayList%3CString
@@ -1034,16 +1034,22 @@
 private 
+final 
 ArrayLis
@@ -1242,21 +1242,44 @@
 start = 
+checkNotNull(start, %22
 start
+%22)
 ;%0A    th
@@ -1300,76 +1300,156 @@
 s = 
-destinations;%0A    this.interests = interests;%0A    this.route = route
+checkNotNull(destinations, %22destinations%22);%0A    this.interests = checkNotNull(interests, %22interests%22);%0A    this.route = checkNotNull(route, %22route%22)
 ;%0A  

Add a check to handle null values passed into constructor