@Test
  public void testBigUtfString() throws Exception {
    StringBuilder sb = new StringBuilder(100000);
    for (int i = 0; i < 100000; i++) {
      if ((i % 2) == 0) {
        sb.append(Character.MAX_VALUE);
      } else {
        sb.append(Character.MIN_VALUE);
      }
    }
    String value = sb.toString();

    DataOutputStream out = getDataOutput();
    DataSerializer.writeString(value, out);
    DataSerializer.writeObject(value, out);
    out.flush();

    DataInput in = getDataInput();
    String value2 = DataSerializer.readString(in);
    assertEquals(value, value2);
    value2 = DataSerializer.readObject(in);
    assertEquals(value, value2);
  }
Tests data serializing a non-<code>null</code> {@link String} longer than 64k.
geode-core/src/test/java/org/apache/geode/internal/DataSerializableJUnitTest.java