public boolean setWaypoints(@Nullable final List<Waypoint> waypoints, final boolean saveToDatabase) {
        this.waypoints.clear();
        if (waypoints != null) {
            this.waypoints.addAll(waypoints);
        }
        if (waypoints != null) {
            for (final Waypoint waypoint : waypoints) {
                waypoint.setGeocode(geocode);
            }
        }
        resetFinalDefined();
        return saveToDatabase && DataStore.saveWaypoints(this);
    }
@param waypoints      List of waypoints to set for cache
@param saveToDatabase Indicates whether to add the waypoints to the database. Should be false if
                      called while loading or building a cache
@return {@code true} if waypoints successfully added to waypoint database
main/src/main/java/cgeo/geocaching/models/Geocache.java