code: public ValueMap getValueMap(Object key) {
      Object value = get(key);
      if (value instanceof ValueMap) {
        return (ValueMap) value;
      } else if (value instanceof Map) {
        //noinspection unchecked
        return new ValueMap((Map<String, Object>) value);
      } else {
        return null;
      }
    }
docs: Returns the value mapped by {@code key} if it exists and is a {@link ValueMap}. Returns null
  otherwise.