private boolean setAsStart(final int position) {
        if (position < 1 || position >= routeItemAdapter.getItems().size()) {
            return false;
        }
        SimpleDialog.ofContext(this).setTitle(TextParam.id(R.string.individual_route_set_as_start_title)).setMessage(TextParam.id(R.string.individual_route_set_as_start_message)).confirm(() -> {
            final ArrayList<RouteItem> newRouteItems = new ArrayList<>();
            for (int i = position; i < routeItemAdapter.getItems().size(); i++) {
                newRouteItems.add(routeItemAdapter.getItems().get(i));
            }
            for (int i = 0; i < position; i++) {
                newRouteItems.add(routeItemAdapter.getItems().get(i));
            }
            routeItemAdapter.setItems(newRouteItems);
        });
        return true;
    }
experimental function for optimizing a route by using tsp-specific algorithm
main/src/main/java/cgeo/geocaching/maps/routing/RouteSortActivity.java