public FieldType calcFieldType( String content ) {
        final SnippetBuilder.SnippetType snippetType = SnippetBuilder.getType( content );
        if ( snippetType == SnippetBuilder.SnippetType.FORALL ) {
            return FieldType.FORALL_FIELD;
        } else if ( snippetType != SnippetBuilder.SnippetType.SINGLE ) {
            return FieldType.NORMAL_FIELD;
        }
        for ( String op : operators ) {
            if ( content.endsWith( op ) ) {
                return FieldType.OPERATOR_FIELD;
            }
        }
        return content.endsWith( "?" ) ? FieldType.QUESTION_FIELD : FieldType.SINGLE_FIELD;
    }
@Test
    public void testIdentifyFieldTypes() {
        builder = new LhsBuilder(9, 1, "");
        
        assertThat(builder.calcFieldType("age")).isEqualTo(SINGLE_FIELD);
        assertThat(builder.calcFieldType("age <")).isEqualTo(OPERATOR_FIELD);
        assertThat(builder.calcFieldType("age < $param")).isEqualTo(NORMAL_FIELD);
        assertThat(builder.calcFieldType("forall(||){age < $}")).isEqualTo(FORALL_FIELD);
        assertThat(builder.calcFieldType("forall(&&){age < $}")).isEqualTo(FORALL_FIELD);
        assertThat(builder.calcFieldType("forall(,){age < $}")).isEqualTo(FORALL_FIELD);
        assertThat(builder.calcFieldType("forall(){age < $}")).isEqualTo(FORALL_FIELD);
        assertThat(builder.calcFieldType("forall(){age < $} && forall(){age == $}")).isEqualTo(FORALL_FIELD);
        assertThat(builder.calcFieldType("x && forall(){age < $} && forall(){age == $}")).isEqualTo(FORALL_FIELD);
        assertThat(builder.calcFieldType("x && forall(){age < $} && forall(){age == $} && y")).isEqualTo(FORALL_FIELD);
        assertThat(builder.calcFieldType("age < $para")).isEqualTo(SINGLE_FIELD);
        assertThat(builder.calcFieldType("forall{||}{age < $}")).isEqualTo(SINGLE_FIELD);
        assertThat(builder.calcFieldType("forall(){}")).isEqualTo(SINGLE_FIELD);
        assertThat(builder.calcFieldType("forall(){age < $")).isEqualTo(SINGLE_FIELD);
        assertThat(builder.calcFieldType("forall(){,")).isEqualTo(SINGLE_FIELD);
        assertThat(builder.calcFieldType("forall({})")).isEqualTo(SINGLE_FIELD);
        assertThat(builder.calcFieldType("forall({}){test})")).isEqualTo(SINGLE_FIELD);
        assertThat(builder.calcFieldType("forall(&&){{}})")).isEqualTo(SINGLE_FIELD);
        assertThat(builder.calcFieldType("forall(&&){{})")).isEqualTo(SINGLE_FIELD);
    }