@@ -0,0 +1,2785 @@
+package com.bluecatcode.hamcrest.matchers;%0A%0Aimport org.hamcrest.Description;%0Aimport org.hamcrest.Factory;%0Aimport org.hamcrest.Matcher;%0Aimport org.hamcrest.TypeSafeMatcher;%0A%0Aimport javax.annotation.Nullable;%0A%0Apublic class MatcherBuilder%3CT%3E extends TypeSafeMatcher%3CT%3E %7B%0A    protected final T item;%0A    private final ItemMatcher%3CT%3E itemMatcher;%0A    private final ObjectDescriber%3CT%3E objectDescriber;%0A    private final MismatchDescriber%3CT%3E mismatchDescriber;%0A%0A    public MatcherBuilder(T item,%0A                          ItemMatcher%3CT%3E itemMatcher,%0A                          ObjectDescriber%3CT%3E objectDescriber,%0A                          MismatchDescriber%3CT%3E mismatchDescriber) %7B%0A        if (itemMatcher == null) %7B%0A            throw new IllegalArgumentException(%22Expected an item matcher%22);%0A        %7D%0A        if (objectDescriber == null) %7B%0A            throw new IllegalArgumentException(%22Expected an object description%22);%0A        %7D%0A        if (mismatchDescriber == null) %7B%0A            throw new IllegalArgumentException(%22Expected an mismatch describer%22);%0A        %7D%0A        this.item = item;%0A        this.itemMatcher = itemMatcher;%0A        this.objectDescriber = objectDescriber;%0A        this.mismatchDescriber = mismatchDescriber;%0A    %7D%0A%0A    @Override%0A    protected boolean matchesSafely(@Nullable T item) %7B%0A        return itemMatcher.match(item);%0A    %7D%0A%0A    @Override%0A    public void describeMismatchSafely(T item, Description mismatchDescription) %7B%0A        mismatchDescriber.describe(item, mismatchDescription);%0A    %7D%0A%0A    @Override%0A    public void describeTo(Description description) %7B%0A        objectDescriber.describe(item, description);%0A    %7D%0A%0A    interface ItemMatcher%3CT%3E %7B%0A        boolean match(@Nullable T item);%0A    %7D%0A%0A    interface MismatchDescriber%3CT%3E %7B%0A        Description describe(@Nullable T item, Description mismatchDescription);%0A    %7D%0A%0A    interface ObjectDescriber%3CT%3E %7B%0A        Description describe(@Nullable T item, Description description);%0A    %7D%0A%0A    @Factory%0A    public static %3CT%3E Matcher%3CT%3E newMatcher(T item,%0A                                            ItemMatcher%3CT%3E itemMatcher,%0A                                            ObjectDescriber%3CT%3E objectDescriber,%0A                                            MismatchDescriber%3CT%3E mismatchDescriber) %7B%0A        return new MatcherBuilder%3C%3E(item, itemMatcher, objectDescriber, mismatchDescriber);%0A    %7D%0A%0A    @Factory%0A    public static %3CT%3E Matcher%3CT%3E newMatcher(T item,%0A                                            ItemMatcher%3CT%3E itemMatcher) %7B%0A        return new MatcherBuilder%3C%3E(item, itemMatcher,%0A                (o, description) -%3E description.appendText(o == null ? %22null%22 : o.getClass().getSimpleName()),%0A                (i, mismatchDescription) -%3E mismatchDescription.appendText(%22was %22).appendValue(i)%0A        );%0A    %7D%0A%7D%0A

Add MatcherBuilder