@Test public void testMatch() throws IOException { MatcherContext context = mock( MatcherContext.class ); Section base = mock( Section.class ); Element sectionElem = mock( Element.class ); doReturn( 1 ).when( base ).getElementCount(); doReturn( sectionElem ).when( base ).getElement( 0 ); ReportElement elem = ReportStructureMatcher.match( context, base, "*" ); assertThat( elem, is( equalTo( (ReportElement) sectionElem ) ) ); verify( context ).setSingleSelectionHint( true ); }
public static ReportElement match( final MatcherContext context, final ReportElement base, final NodeMatcher parse ) { if ( parse == null ) { throw new NullPointerException(); } context.setSingleSelectionHint( true ); return new NodeIterator().get( context, base, parse ); }
ReportStructureMatcher { public static ReportElement match( final MatcherContext context, final ReportElement base, final NodeMatcher parse ) { if ( parse == null ) { throw new NullPointerException(); } context.setSingleSelectionHint( true ); return new NodeIterator().get( context, base, parse ); } }
ReportStructureMatcher { public static ReportElement match( final MatcherContext context, final ReportElement base, final NodeMatcher parse ) { if ( parse == null ) { throw new NullPointerException(); } context.setSingleSelectionHint( true ); return new NodeIterator().get( context, base, parse ); }  }
ReportStructureMatcher { public static ReportElement match( final MatcherContext context, final ReportElement base, final NodeMatcher parse ) { if ( parse == null ) { throw new NullPointerException(); } context.setSingleSelectionHint( true ); return new NodeIterator().get( context, base, parse ); }  static NodeMatcher parse( final String s ); static ReportElement match( final MatcherContext context, final ReportElement base, final NodeMatcher parse ); static ReportElement[] matchAll( final MatcherContext context, final ReportElement base,
      final NodeMatcher parse ); static ReportElement match( final MatcherContext context, final ReportElement base, final String selector ); static ReportElement[] matchAll( final MatcherContext context, final ReportElement base, final String selector ); static ReportElement[] findElementsByName( final ReportElement section, final String name ); static ReportElement[] findElementsByAttribute( final ReportElement section, final String ns, final String name ); static ReportElement[] findElementsByAttribute( final ReportElement section, final String ns,
      final String name, final Object value ); static ReportElement[] findElementsByType( final ReportElement section, final ElementType type ); static ReportElement findElementByType( final Element element, final ElementType type ); }
ReportStructureMatcher { public static ReportElement match( final MatcherContext context, final ReportElement base, final NodeMatcher parse ) { if ( parse == null ) { throw new NullPointerException(); } context.setSingleSelectionHint( true ); return new NodeIterator().get( context, base, parse ); }  static NodeMatcher parse( final String s ); static ReportElement match( final MatcherContext context, final ReportElement base, final NodeMatcher parse ); static ReportElement[] matchAll( final MatcherContext context, final ReportElement base,
      final NodeMatcher parse ); static ReportElement match( final MatcherContext context, final ReportElement base, final String selector ); static ReportElement[] matchAll( final MatcherContext context, final ReportElement base, final String selector ); static ReportElement[] findElementsByName( final ReportElement section, final String name ); static ReportElement[] findElementsByAttribute( final ReportElement section, final String ns, final String name ); static ReportElement[] findElementsByAttribute( final ReportElement section, final String ns,
      final String name, final Object value ); static ReportElement[] findElementsByType( final ReportElement section, final ElementType type ); static ReportElement findElementByType( final Element element, final ElementType type );  }