@Test
  public void testNonAsciiEncoding() {
    MemoryBoundedLogMessageBuffer buf = new MemoryBoundedLogMessageBuffer(TEN_KB);

    buf.add(JP_TEXT);
    StringWriter sw = new StringWriter();
    buf.dumpTo(new PrintWriter(sw));
    String dump = sw.toString();
    assertTrue(dump.contains(JP_TEXT));
  }
Test case for the MemoryBoundedLogMessageBuffer utility. Ensures that it uses no more memory than
it's supposed to, and that it properly deals with multibyte encodings.
hbase-server/src/test/java/org/apache/hadoop/hbase/monitoring/TestMemoryBoundedLogMessageBuffer.java