@Override
  public void testStupidlyLargeSetAndSizeOverride() throws Exception {
    Random r = new Random();
    SerializingTranscoder st = new SerializingTranscoder(Integer.MAX_VALUE);

    st.setCompressionThreshold(Integer.MAX_VALUE);

    byte[] data = new byte[21 * 1024 * 1024];
    r.nextBytes(data);

    OperationFuture<Boolean> setResult = client.set("bigassthing", 60, data, st);
    assertFalse(setResult.get());
    assertEquals(StatusCode.ERR_2BIG, setResult.getStatus().getStatusCode());

    client.set("k", 5, "Blah");
    assertEquals("Blah", client.get("k"));
  }
This test assumes a binary server is running on the host specified int the
environment variable SPYMC_TEST_SERVER_V4 or localhost:11211 by default.
src/test/java/net/spy/memcached/BinaryClientTest.java