public void testBadOperation() throws Exception {
    client.mconn.enqueueOperation("x",
        new ExtensibleOperationImpl(new OperationCallback() {
          public void complete() {
            System.err.println("Complete.");
          }

          public void receivedStatus(OperationStatus s) {
            System.err.println("Received a line.");
          }
        }) {

        @Override
        public void handleLine(String line) {
          System.out.println("Woo! A line!");
        }

        @Override
        public void initialize() {
          setBuffer(ByteBuffer.wrap("garbage\r\n".getBytes()));
        }
      });
  }
This test assumes a server is running on the host specified in the
environment variable SPY_MC_TEST_SERVER or localhost:11211 by default.
src/test/java/net/spy/memcached/AsciiClientTest.java