docs: @Override
  	public byte[] serializeAttributes(final MemcachedBackupSession sessions, final ConcurrentMap<String, Object> attributes) {
  		if (attributes == null) {
          	throw new NullPointerException();
          }
  
          final ByteArrayOutputStream bos = new ByteArrayOutputStream();
          try {
          	// This performs a deep serialization of the target instance.
              // It's serialized to a string as flexjson doesn't like writing to
              // an OutputStreamWriter: it throws the exception "Stepping back two steps is not supported".
              // See https://github.com/moresandeep/memcached-session-manager/commit/db2faaa0a846e16d65ac0b14819689c67bf92c68#commitcomment-512505
          	final String serResult = serializer.deepSerialize(attributes);
          	if (LOG.isDebugEnabled()) {
          	    LOG.debug("JSON Serialised object: " + serResult);
          	}
          	return serResult.getBytes(); // converts to bytes
          } catch (final Exception e) {
          	LOG.warn("Caught Exception deserializing JSON " + e);
          	throw new IllegalArgumentException();
          } finally {
          	close(bos);
          }
  	}