public void recalculate(final double OFFSET) {
        List<Stop> stops = new ArrayList<>(sortedStops.size());
        for (Stop stop : sortedStops) {
            double newOffset = (stop.getOffset() + OFFSET) % 1;
            if(Double.compare(newOffset, 0d) == 0) {
                newOffset = 1.0;
                stops.add(new Stop(0.000001, stop.getColor()));
            } else if (stop.getOffset() + OFFSET > 1d) {
                newOffset -= 0.000001;
            }
            stops.add(new Stop(newOffset, stop.getColor()));
        }

        HashMap<Double, Color> stopMap = new LinkedHashMap<>(stops.size());
        for (Stop stop : stops) {
            stopMap.put(stop.getOffset(), stop.getColor());
        }

        List<Stop> sortedStops2 = new LinkedList<>();
        SortedSet<Double> sortedFractions = new TreeSet<>(stopMap.keySet());
        if (sortedFractions.last() < 1) {
            stopMap.put(1.0, stopMap.get(sortedFractions.first()));
            sortedFractions.add(1.0);
        }
        if (sortedFractions.first() > 0) {
            stopMap.put(0.0, stopMap.get(sortedFractions.last()));
            sortedFractions.add(0.0);
        }
        for (Double fraction : sortedFractions) {
            sortedStops2.add(new Stop(fraction, stopMap.get(fraction)));
        }
        sortedStops.clear();
        sortedStops.addAll(sortedStops2);
    }