This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | public List<Trip> getTripsByUser(User user) throws UserNotLoggedInException { | |
| User loggedUser = UserSession.getInstance().getLoggedUser(); | |
| if(loggedUser == null){ | |
| throw new UserNotLoggedInException(); | |
| } | |
| List<Trip> tripList = new ArrayList<Trip>(); | |
| boolean isFriend = isFriendOf(user, loggedUser); | |
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | public List<Trip> getTripsByUser(User user) throws UserNotLoggedInException { | |
| User loggedUser = UserSession.getInstance().getLoggedUser(); | |
| if(loggedUser == null){ | |
| throw new UserNotLoggedInException(); | |
| } | |
| return isFriend(user.getFriends(), loggedUser) ? | |
| TripDAO.findTripsByUser(user) : new ArrayList<Trip>(); | |
| } | 
OlderNewer