Refactoring tripService to get better design, 1. UserSession is should be depend on UI or Web Framework things. so, break that dependency to change method signature getTripsByUser(User) -> getTripsByUser(User, loggedInuser). 2. Remove TestableTripService by removing static method call and using mockito