    public void addJourney(final Place start, final Place end, final List<String> activities) {
        final List<JourneyStep> steps = JourneyUtil.getSteps(activities);
        final Collection<Journey> journeys = findJourneys(start, end);
        for (Journey journey : journeys) {
            if (journey.getSteps() == steps.size()) {
                final List<JourneyStep> theirSteps = getSteps(journey);
                if (theirSteps.equals(steps)) {
                    updateJourneyStatement.bindLong(1, journey.getId());
                    updateJourneyStatement.execute();
                    return;
                }
            }
        }
        insertJourneyStatement.bindLong(1, start.getId());
        insertJourneyStatement.bindLong(2, end.getId());
        insertJourneyStatement.bindLong(3, steps.size());
        final long id = insertJourneyStatement.executeInsert();
        long next = 0;
        for (int i = steps.size() - 1; i >= 0; i--) {
            final JourneyStep step = steps.get(i);
            insertJourneyStepStatement.bindString(1, step.getActivity());
            insertJourneyStepStatement.bindLong(2, step.getRepetitions());
            insertJourneyStepStatement.bindLong(3, id);
            insertJourneyStepStatement.bindLong(4, next);
            next = insertJourneyStepStatement.executeInsert();
        }
    }

    public void addJourney(final Place start, final Place end, final List<String> activities) {
        final List<JourneyStep> steps = JourneyUtil.getSteps(activities);
        final Collection<Journey> journeys = findJourneys(start, end);
        for (Journey journey : journeys) {
            if (journey.getSteps() == steps.size()) {
                final List<JourneyStep> theirSteps = getSteps(journey);
                if (JourneyUtil.isCompatible(steps, theirSteps)) {
                    updateJourneyStatement.bindLong(1, journey.getId());
                    updateJourneyStatement.execute();
                    return;
                }
            }
        }
        insertJourneyStatement.bindLong(1, start.getId());
        insertJourneyStatement.bindLong(2, end.getId());
        insertJourneyStatement.bindLong(3, steps.size());
        final long id = insertJourneyStatement.executeInsert();
        long next = 0;
        for (int i = steps.size() - 1; i >= 0; i--) {
            final JourneyStep step = steps.get(i);
            insertJourneyStepStatement.bindString(1, step.getActivity());
            insertJourneyStepStatement.bindLong(2, step.getRepetitions());
            insertJourneyStepStatement.bindLong(3, id);
            insertJourneyStepStatement.bindLong(4, next);
            next = insertJourneyStepStatement.executeInsert();
        }
    }
