@Override
  public <T> void setState(final String key, final T val) {
    // _log.debug("set state: " + key + " " + val);

    synchronized (_state) {
      _state.put(key, Utils.serialize(val));
    }
  }
 public MockStateService(Map<String, Object> config) {
   this();
   synchronized (_state) {
     for (Entry<String, Object> e : config.entrySet()) {
       _state.put(e.getKey(), Utils.serialize(e.getValue()));
     }
   }
 }