app/repository/TripRepository.java
public CompletionStage<Optional<Integer>> delete(int tripID) {
        return supplyAsync(() -> {
            try {
                final Optional<Trip> tripOptional = Optional.ofNullable(ebeanServer.find(Trip.class).setId(tripID).findOne());
                tripOptional.ifPresent(Model::delete);
                return tripOptional.map(Trip::getId);
            } catch (Exception e) {
                return Optional.empty();
            }
        }, executionContext);
    }
/**
     * Removes a trip from the database
     * @param tripID the id of the trip to remove
     * @return the completionStage
     */
Removes a trip from the database
@param tripID the id of the trip to remove
@return the completionStage
Removes a trip from the database @param tripID the id of the trip to remove @return the completionStage
public CompletionStage<Optional<Integer>> delete(int tripID) {
        return supplyAsync(() -> {
            try {
                final Optional<Trip> tripOptional = Optional.ofNullable(ebeanServer.find(Trip.class).setId(tripID).findOne());
                tripOptional.ifPresent(Model::delete);
                return tripOptional.map(Trip::getId);
            } catch (Exception e) {
                return Optional.empty();
            }
        }, executionContext);
    }
public CompletionStage < Optional < Integer > > delete ( int tripID ) { return supplyAsync ( ( ) -> { try { final Optional < Trip > tripOptional = Optional . ofNullable ( ebeanServer . find ( Trip . class ) . setId ( tripID ) . findOne ( ) ) ; tripOptional . ifPresent ( Model :: delete ) ; return tripOptional . map ( Trip :: getId ) ; } catch ( Exception e ) { return Optional . empty ( ) ; } } , executionContext ) ; }
Removes a trip from the database
 @param tripID the id of the trip to remove
 @return the completionStage
Removes a trip from the database @param tripID the id of the trip to remove @return the completionStage