package org.monospark.spongematchers.matcher;

import java.util.Set;
import java.util.regex.Pattern;

import com.google.common.collect.Sets;

public final class BaseMatchers {

    private BaseMatchers() {}
    
    public static <T, M extends SpongeMatcher<T>> M wildcard() {
        @SuppressWarnings("unchecked")
        M matcher = (M) new SpongeMatcher<T>() {

            @Override
            public boolean matches(T o) {
                return true;
            }
        };
        return matcher;
    }
    
    @SafeVarargs
    public static <T> SpongeMatcher<T> amount(SpongeMatcher<T>... matchers) {
        return amount(Sets.newHashSet(matchers));
    }
    
    public static <T> SpongeMatcher<T> amount(Set<SpongeMatcher<T>> matchers) {
        return new SpongeMatcher<T>() {
            @Override
            public boolean matches(T o) {
                for (SpongeMatcher<T> m : matchers) {
                    if (m.matches(o)) {
                        return true;
                    }
                }
                return false;
            }
        };
    }
    
    public static SpongeMatcher<String> regex(String regex) {
        Pattern pattern = Pattern.compile(regex);
        return new SpongeMatcher<String>() {

            @Override
            public boolean matches(String o) {
                return pattern.matcher(o).matches();
            }
        };
    }
}

@@ -40,16 +40,39 @@
 tcher;%0A%0A
+import java.util.List;%0A
 import j
@@ -1104,32 +1104,656 @@
   %7D;%0A    %7D%0A    %0A
+    public static %3CT%3E SpongeMatcher%3CList%3CT%3E%3E listWrapper(SpongeMatcher%3CT%3E matcher, boolean allMatch) %7B%0A        return new SpongeMatcher%3CList%3CT%3E%3E() %7B%0A            @Override%0A            public boolean matches(List%3CT%3E o) %7B%0A                for (T element : o) %7B%0A                    boolean matches = matcher.matches(element);%0A                    if (matches && !allMatch) %7B%0A                        return true;%0A                    %7D%0A                    else if (!matches && allMatch) %7B%0A                        return false;%0A                    %7D%0A                %7D%0A                return true;%0A            %7D%0A        %7D;%0A    %7D%0A    %0A
     public stati

Add support for list matching again