@Override
  public Map<String, Object> encode(Object object) throws EncodeException {
    if (object == null) {
      return Collections.emptyMap();
    }
    ObjectParamMetadata metadata =
        classToMetadata.computeIfAbsent(object.getClass(), ObjectParamMetadata::parseObjectType);

    return metadata.objectFields.stream()
        .map(field -> this.FieldValuePair(object, field))
        .filter(fieldObjectPair -> fieldObjectPair.right.isPresent())
        .collect(Collectors.toMap(this::fieldName,
            fieldObjectPair -> fieldObjectPair.right.get()));

  }
@Test
  void defaultEncoder_withOverriddenParamName() {
    HashSet<Object> expectedNames = new HashSet<>();
    expectedNames.add("fooAlias");
    expectedNames.add("bar");
    final NormalObjectWithOverriddenParamName normalObject =
        new NormalObjectWithOverriddenParamName("fooz", "barz");

    final Map<String, Object> encodedMap = encoder.encode(normalObject);

    assertThat(encodedMap.keySet()).as("@Param ignored").isEqualTo(expectedNames);
  }