@Test
public void testProduceCriteriaWithRemappedNames() throws Exception {

    Map<RequestObject, Object> filters = ImmutableMap.of(
            RequestLogicalOperator.of(LogicalOperatorType.OR),
            ImmutableMap.of(
                    RequestField.of("name"), ImmutableMap.of(RequestOperator.of(OperatorType.STARTS_WITH), "John"),
                    RequestField.of("secondName"), ImmutableMap.of(RequestOperator.of(OperatorType.STARTS_WITH), "Bob"),
                    RequestField.of("lastName"), ImmutableMap.of(RequestOperator.of(OperatorType.IN), Lists.newArrayList("Doe", "Smith"))
            )
    );
    FieldMapper fieldMapper = FieldMapper.of(ImmutableMap.of(
            "name", "remappedName",
            "lastName", "remappedLastName"
    ));
    Criteria result = requestParamsCriteriaBuilder.build(filters, fieldMapper);
    assertThat(result).isEqualTo(new Criteria().orOperator(
            Criteria.where("remappedName").regex("^John", "i"),
            Criteria.where("secondName").regex("^Bob", "i"),
            Criteria.where("remappedLastName").in("Doe", "Smith")));
}