package nl.orangeflamingo.domain;

import org.springframework.data.jpa.domain.Specification;

public class SongSpecs {

    public static Specification<Song> songWithArtistOrTitleLike(String queryString) {
        return (Specification<Song>) (root, query, builder) ->
                builder.or(builder.like(builder.lower(root.get("artist")), getLowercaseQueryWithWildcards(queryString)),
                builder.like(builder.lower(root.get("title")), getLowercaseQueryWithWildcards(queryString)));
    }

    private static String getLowercaseQueryWithWildcards(String query) {
        return "%" + query.toLowerCase() + "%";
    }
}

@@ -113,16 +113,91 @@
 pecs %7B%0A%0A
+    private SongSpecs() %7B%0A        // prevent from instantiating%0A    %7D%0A    %0A
     publ

Add private constructor