@Override
    public String toString() {
        if (updatedAfterCachedForToString) {
            StringBuilder toString = new StringBuilder();
            AtomicBoolean first = new AtomicBoolean(true);
            if (toString != null) {
                toString.append("[");
            }
            forEach((range) -> {
                if (!first.get()) {
                    toString.append(",");
                }
                toString.append(range);
                first.set(false);
                return true;
            });
            toString.append("]");
            cachedToString = toString.toString();
            updatedAfterCachedForToString = false;
        }
        return cachedToString;
    }
@Test
    public void testToString() {
        OpenLongPairRangeSet<LongPair> set = new OpenLongPairRangeSet<>(consumer);
        Range<LongPair> range = Range.openClosed(new LongPair(0, 97), new LongPair(0, 99));
        set.add(range);
        assertEquals(set.toString(), "[(0:97..0:99]]");
        range = Range.openClosed(new LongPair(0, 98), new LongPair(0, 105));
        set.add(range);
        assertEquals(set.toString(), "[(0:97..0:105]]");
        range = Range.openClosed(new LongPair(0, 5), new LongPair(0, 75));
        set.add(range);
        assertEquals(set.toString(), "[(0:5..0:75],(0:97..0:105]]");
    }