TripService refactored
authorGustavo Martin Morcuende <gu.martinm@gmail.com>
Thu, 24 Nov 2016 23:51:30 +0000 (00:51 +0100)
committerGustavo Martin Morcuende <gu.martinm@gmail.com>
Thu, 24 Nov 2016 23:51:30 +0000 (00:51 +0100)
TDD/src/main/java/org/craftedsw/tripservicekata/trip/TripService.java

index 8061d2f..5a19beb 100644 (file)
@@ -16,7 +16,11 @@ public class TripService {
                \r
                return user.isFriendsWith(getLoggedInUser())\r
                                ? tripsBy(user)\r
-                           : new ArrayList<>();\r
+                           : noTrips();\r
+       }\r
+\r
+       private ArrayList<Trip> noTrips() {\r
+               return new ArrayList<>();\r
        }\r
 \r
        protected List<Trip> tripsBy(User user) {\r