/*
 *
 * Copyright (c) 2006-2020, Speedment, Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); You may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at:
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

package com.speedment.runtime.connector.mysql.internal;

import com.speedment.runtime.core.db.FieldPredicateView;
import com.speedment.runtime.core.db.SqlPredicateFragment;
import com.speedment.test.connector.abstracts.DefaultFieldPredicateViewMixin;

import java.util.Collections;
import java.util.List;
import java.util.function.Predicate;
import java.util.regex.Pattern;

final class MySqlFieldPredicateViewTest extends DefaultFieldPredicateViewMixin {

    private static final Pattern COMPARE_COLLATE_PATTERN = Pattern.compile("\\([A-Za-z]+\\s?(=|>|>=|<|<=)\\s?\\?\\sCOLLATE\\s[0-9a-z_]+\\)");

    @Override
    protected FieldPredicateView getFieldPredicateViewInstance() {
        return new MySqlSpeedmentPredicateView("utf8_bin", "utf8_general_ci");
    }

    @Override
    protected List<Predicate<SqlPredicateFragment>> compareConditions() {
        Predicate<SqlPredicateFragment> regularPredicate =
                sqlPredicateFragment -> COMPARE_PATTERN.matcher(sqlPredicateFragment.getSql()).find();
        Predicate<SqlPredicateFragment> collationPredicate =
                sqlPredicateFragment -> COMPARE_COLLATE_PATTERN.matcher(sqlPredicateFragment.getSql()).find();

        return Collections.singletonList(regularPredicate.or(collationPredicate));
    }
}

@@ -1479,32 +1479,38 @@
 ons() %7B%0A        
+final 
 Predicate%3CSqlPre
@@ -1536,36 +1536,32 @@
 ularPredicate =%0A
-    
             sqlP
@@ -1651,16 +1651,22 @@
         
+final 
 Predicat
@@ -1702,36 +1702,32 @@
 tionPredicate =%0A
-    
             sqlP

Add missing final modifiers