@@ -0,0 +1,1613 @@
+/*%0A * #%25L%0A * wcm.io%0A * %25%25%0A * Copyright (C) 2020 wcm.io%0A * %25%25%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 * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A * #L%25%0A */%0Apackage io.wcm.qa.glnm.hamcrest;%0A%0Aimport org.hamcrest.Description;%0Aimport org.hamcrest.Matcher;%0A%0Aimport io.wcm.qa.glnm.sampling.element.ElementCountSampler;%0Aimport io.wcm.qa.glnm.selectors.base.Selector;%0A%0A/**%0A * Matches how many visible elements are defined by selector.%0A *%0A * @since 5.0.0%0A */%0Apublic class ElementCount extends SelectorSamplerMatcher%3CInteger%3E %7B%0A%0A  /**%0A   * Constructor.%0A   *%0A   * @param matcher integer matcher%0A   */%0A  public ElementCount(Matcher%3CInteger%3E matcher) %7B%0A    super(matcher, ElementCountSampler.class);%0A  %7D%0A%0A  /** %7B@inheritDoc%7D */%0A  @Override%0A  public void describeTo(Description description) %7B%0A    description.appendText(%22number of elements %22);%0A    super.describeTo(description);%0A  %7D%0A%0A  /**%0A   * How many elements defined by selector are visible%0A   *%0A   * @return matcher%0A   * @param matcher a %7B@link org.hamcrest.Matcher%7D object.%0A   */%0A  public static Matcher%3CSelector%3E elementCount(Matcher%3CInteger%3E matcher) %7B%0A    return new ElementCount(matcher);%0A  %7D%0A%7D%0A

add element counting matcher