public StatsOutputStream writePair(String name, boolean value) {
        checkSeparator();
        write('"').writeEncoded(name).write("\":").write(value);
        return this;
    }
@Test
    public void testPairs() {
        stream.writePair("my-count", 1);
        assertEquals(str(), "\"my-count\":1");

        stream.writePair("my-rate", 0.0);
        assertEquals(str(), "\"my-rate\":0.0");

        stream.writePair("my-flag", true);
        assertEquals(str(), "\"my-flag\":true");

        stream.writePair("my-string", "value");
        assertEquals(str(), "\"my-string\":\"value\"");
    }