@Test
public void testFilterFromFieldFollowedByLogicalOperatorToOperatorShouldProduceProperCriteria() throws Exception {

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