public synchronized long getEditDelayMillis() {
			removeExpiredReversions();

			if (currentDelayCached)
				return currentDelayMillis;
			else {
				long result = MAX_DELAY_MILLIS;

				if (!recentReversionDelaysMillis.isEmpty()) {
					long reversionDelayTotal = 0L;
					int n = 0;

					for (Long l : recentReversionDelaysMillis) {
						reversionDelayTotal += l;
						if (reversionDelayTotal < 0)
							reversionDelayTotal = Long.MAX_VALUE;
						n++;
						if (n < 0)
							n = Integer.MAX_VALUE;
					}

					result = Math.min(Math.max(reversionDelayTotal / n, MIN_DELAY_MILLIS), MAX_DELAY_MILLIS);
				}

				currentDelayMillis = result;
				currentDelayCached = true;

				return result;
			}
		}