@@ -0,0 +1,1046 @@
+package org.mutabilitydetector;%0A%0Aimport org.hamcrest.Description;%0Aimport org.hamcrest.Matcher;%0Aimport org.hamcrest.TypeSafeDiagnosingMatcher;%0Aimport org.mutabilitydetector.checkers.IMutabilityChecker;%0A%0A/*%0A * Mutability Detector%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A *%0A * Further licensing information for this project can be found in %0A * %09%09license/LICENSE.txt%0A */%0A%0Apublic class TestMatchers %7B%0A%0A%09%0A%09public static Matcher%3C? super IMutabilityChecker%3E hasReasons() %7B%0A%09%09return new TypeSafeDiagnosingMatcher%3CIMutabilityChecker%3E() %7B%0A%0A%09%09%09@Override protected boolean matchesSafely(IMutabilityChecker item, Description mismatchDescription) %7B%0A%09%09%09%09%0A%09%09%09%09mismatchDescription.appendText(%22 got a checker (%22 + item.toString() + %22) containing zero reasons %22);%0A%09%09%09%09return !(item.reasons().isEmpty());%0A%09%09%09%7D%0A%0A%09%09%09@Override public void describeTo(Description description) %7B%0A%09%09%09%09description.appendText(%22 got a checker reporting at least one reason %22);%0A%09%09%09%7D%0A%0A%09%09%7D;%0A%09%7D%0A%09%0A%7D%0A

Add a matcher for testing that a checker reports reasons - currently the AnalysisResult will prevent this in practice, with an IllegalArgumentException, but that may not always be the case, so keep the check.