@@ -0,0 +1,762 @@
+package com.ljs.ai.search.hillclimbing;%0A%0Aimport com.google.common.base.Predicate;%0Aimport com.google.common.base.Predicates;%0A%0A/**%0A *%0A * @author lstephen%0A */%0Apublic final class Validators %7B%0A%0A    public static %3CS%3E Validator%3CS%3E alwaysTrue() %7B%0A        return from(Predicates.%3CS%3EalwaysTrue());%0A    %7D%0A%0A    private static %3CS%3E Validator%3CS%3E from(Predicate%3CS%3E predicate) %7B%0A        return new PredicateValidator%3CS%3E(predicate);%0A    %7D%0A%0A    private static final class PredicateValidator%3CS%3E implements Validator%3CS%3E %7B%0A%0A        private final Predicate%3CS%3E predicate;%0A%0A        public PredicateValidator(Predicate%3CS%3E predicate) %7B%0A            this.predicate = predicate;%0A        %7D%0A%0A        public Boolean apply(S state) %7B%0A            return predicate.apply(state);%0A        %7D%0A    %7D%0A%0A%7D%0A

Add some helpful construction functions