File tree Expand file tree Collapse file tree
hamcrest-core/src/main/java/org/hamcrest/core Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,8 +47,18 @@ private ArrayList<Matcher<? super T>> templatedListWith(Matcher<? super T> other
4747 * </pre>
4848 */
4949 @ Factory
50- public static <LHS > CombinableMatcher <LHS > both (Matcher <? super LHS > matcher ) {
51- return new CombinableMatcher <LHS >(matcher );
50+ public static <LHS > CombinableBothMatcher <LHS > both (Matcher <? super LHS > matcher ) {
51+ return new CombinableBothMatcher <LHS >(matcher );
52+ }
53+
54+ public static final class CombinableBothMatcher <X > {
55+ private final Matcher <? super X > first ;
56+ public CombinableBothMatcher (Matcher <? super X > matcher ) {
57+ this .first = matcher ;
58+ }
59+ public CombinableMatcher <X > and (Matcher <? super X > other ) {
60+ return new CombinableMatcher <X >(first ).and (other );
61+ }
5262 }
5363
5464 /**
@@ -58,7 +68,17 @@ public static <LHS> CombinableMatcher<LHS> both(Matcher<? super LHS> matcher) {
5868 * </pre>
5969 */
6070 @ Factory
61- public static <LHS > CombinableMatcher <LHS > either (Matcher <? super LHS > matcher ) {
62- return new CombinableMatcher <LHS >(matcher );
71+ public static <LHS > CombinableEitherMatcher <LHS > either (Matcher <? super LHS > matcher ) {
72+ return new CombinableEitherMatcher <LHS >(matcher );
73+ }
74+
75+ public static final class CombinableEitherMatcher <X > {
76+ private final Matcher <? super X > first ;
77+ public CombinableEitherMatcher (Matcher <? super X > matcher ) {
78+ this .first = matcher ;
79+ }
80+ public CombinableMatcher <X > or (Matcher <? super X > other ) {
81+ return new CombinableMatcher <X >(first ).or (other );
82+ }
6383 }
64- }
84+ }
You can’t perform that action at this time.
0 commit comments