ComposeMatchers { @SafeVarargs public static <T> ConjunctionMatcher<T> compose(Matcher<? super T>... matchers) { return compose(null, matchers); } private  ComposeMatchers(); @SafeVarargs static ConjunctionMatcher<T> compose(Matcher<? super T>... matchers); @SafeVarargs static ConjunctionMatcher<T> compose(String compositeDescription, Matcher<? super T>... matchers); static ConjunctionMatcher<T> compose(Iterable<Matcher<? super T>> matchers); static ConjunctionMatcher<T> compose(String compositeDescription, Iterable<Matcher<? super T>> matchers); static Matcher<T> hasFeature(Function<T, U> featureFunction, Matcher<? super U> featureMatcher); static Matcher<T> hasFeature(String featureName, Function<T, U> featureFunction,
		Matcher<? super U> featureMatcher); static Matcher<T> hasFeature(String featureDescription, String featureName,
		Function<T, U> featureFunction, Matcher<? super U> featureMatcher); static Matcher<T> hasFeatureValue(Function<T, U> featureFunction, U featureValue); static Matcher<T> hasFeatureValue(String featureName, Function<T, U> featureFunction, U featureValue); static Matcher<T> hasFeatureValue(String featureDescription, String featureName,
		Function<T, U> featureFunction, U featureValue);  }
@Test public void composeWithMatcherReturnsMatcher() { Matcher<String> actual = compose("x", startsWith("y")).and(endsWith("z")); assertThat(actual.matches("yz"), is(true)); }
@Test public void composeWithMatcherListReturnsMatcher() { Matcher<String> actual = compose("x", asList(startsWith("y"), endsWith("z"))); assertThat(actual.matches("yz"), is(true)); }
@Test public void composeWithSupertypeMatcherListReturnsMatcher() { Matcher<String> actual = compose("x", asList(charSeq(startsWith("y")), charSeq(endsWith("z")))); assertThat(actual.matches("yz"), is(true)); }
@Test public void composeWithMatcherListWithoutDescriptionReturnsMatcher() { Matcher<String> actual = compose(asList(startsWith("y"), endsWith("z"))); assertThat(actual.matches("yz"), is(true)); }
@Test public void composeWithEmptyMatcherListReturnsMatcher() { Matcher<String> actual = compose("x", emptyList()); assertThat(actual.matches("y"), is(true)); }
@Test(expected = NullPointerException.class) public void composeWithNullMatcherListThrowsException() { compose("x", (List<Matcher<? super Object>>) null); }
@Test(expected = NullPointerException.class) public void composeWithMatcherListContainingNullThrowsException() { compose("x", asList(startsWith("y"), null, endsWith("z"))); }
@Test public void composeWithMatchersClonesList() { List<Matcher<? super String>> matchers = new ArrayList<>(); matchers.add(startsWith("y")); Matcher<String> actual = compose("x", matchers); matchers.add(endsWith("z")); assertThat(actual.matches("y"), is(true)); }
@Test public void composeWithSupertypeMatcherReturnsMatcher() { Matcher<String> actual = ComposeMatchers.<String>compose("x", charSeq(startsWith("y"))) .and(charSeq(endsWith("z"))); assertThat(actual.matches("yz"), is(true)); }
@Test public void composeWithMatcherWithoutDescriptionReturnsMatcher() { Matcher<String> actual = compose(startsWith("x")).and(endsWith("y")); assertThat(actual.matches("xy"), is(true)); }
@Test(expected = NullPointerException.class) public void composeWithNullMatcherThrowsException() { compose("x", (Matcher<Object>) null); }
@Test public void composeWithMatcherArrayReturnsMatcher() { Matcher<String> actual = compose("x", startsWith("y"), endsWith("z")); assertThat(actual.matches("yz"), is(true)); }
@Test public void composeWithSupertypeMatcherArrayReturnsMatcher() { Matcher<String> actual = compose("x", charSeq(startsWith("y")), charSeq(endsWith("z"))); assertThat(actual.matches("yz"), is(true)); }
@Test public void composeWithMatcherArrayWithoutDescriptionReturnsMatcher() { Matcher<String> actual = compose(startsWith("x"), endsWith("y")); assertThat(actual.matches("xy"), is(true)); }
@Test(expected = NullPointerException.class) public void composeWithNullMatcherArrayThrowsException() { compose("x", (Matcher<Object>[]) null); }
@Test(expected = NullPointerException.class) public void composeWithMatcherArrayContainingNullThrowsException() { compose("x", startsWith("y"), null, endsWith("z")); }
@Test public void composeWithNoMatcherReturnsMatcher() { Matcher<?> matcher = compose("x"); assertThat(matcher.matches("y"), is(true)); }