static String PrintContents(WriteBatch b) {
		InternalKeyComparator cmp = new InternalKeyComparator(
				BytewiseComparatorImpl.getInstance());
		MemTable mem = new MemTable(cmp);
		mem.Ref();
		StringBuffer state = new StringBuffer();
		Status s = WriteBatchInternal.InsertInto(b, mem);
		int count = 0;
		Iterator iter = mem.NewIterator();
		for (iter.SeekToFirst(); iter.Valid(); iter.Next()) {
			ParsedInternalKey ikey = InternalKey.ParseInternalKey_(iter.key());
			ASSERT_TRUE(ikey != null);
			switch (ikey.type.value) {
			case ValueType.kTypeValue:
				state.append("Put(");
				state.append(ikey.user_key.toString());
				state.append(", ");
				state.append(iter.value().toString());
				state.append(")");
				count++;
				break;
			case ValueType.kTypeDeletion:
				state.append("Delete(");
				state.append(ikey.user_key.toString());
				state.append(")");
				count++;
				break;
			}
			state.append("@");
			state.append(ikey.sequence.value);
		}
		iter = null;
		if (!s.ok()) {
			state.append("ParseError()");
		} else if (count != WriteBatchInternal.Count(b)) {
			state.append("CountMismatch()");
		}
		mem.Unref();
		return state.toString();
	}