@Test public void testMatches() { NodeMatcher left = mock( NodeMatcher.class ); NodeMatcher right = mock( NodeMatcher.class ); MatcherContext context = mock( MatcherContext.class ); ReportElement node = mock( ReportElement.class ); doReturn( false ).when( left ).matches( context, node ); doReturn( false ).when( right ).matches( context, node ); AndMatcher matcher = new AndMatcher( left, right ); assertThat( matcher.matches( context, node ), is( equalTo( false ) ) ); doReturn( true ).when( left ).matches( context, node ); matcher = new AndMatcher( left, right ); assertThat( matcher.matches( context, node ), is( equalTo( false ) ) ); doReturn( true ).when( right ).matches( context, node ); matcher = new AndMatcher( left, right ); assertThat( matcher.matches( context, node ), is( equalTo( true ) ) ); }
public boolean matches( final MatcherContext context, final ReportElement node ) { if ( left.matches( context, node ) == false ) { return false; } if ( right.matches( context, node ) == false ) { return false; } return true; }
AndMatcher implements NodeMatcher { public boolean matches( final MatcherContext context, final ReportElement node ) { if ( left.matches( context, node ) == false ) { return false; } if ( right.matches( context, node ) == false ) { return false; } return true; } }
AndMatcher implements NodeMatcher { public boolean matches( final MatcherContext context, final ReportElement node ) { if ( left.matches( context, node ) == false ) { return false; } if ( right.matches( context, node ) == false ) { return false; } return true; } AndMatcher( final NodeMatcher left, final NodeMatcher right ); }
AndMatcher implements NodeMatcher { public boolean matches( final MatcherContext context, final ReportElement node ) { if ( left.matches( context, node ) == false ) { return false; } if ( right.matches( context, node ) == false ) { return false; } return true; } AndMatcher( final NodeMatcher left, final NodeMatcher right ); boolean matches( final MatcherContext context, final ReportElement node ); String toString(); }
AndMatcher implements NodeMatcher { public boolean matches( final MatcherContext context, final ReportElement node ) { if ( left.matches( context, node ) == false ) { return false; } if ( right.matches( context, node ) == false ) { return false; } return true; } AndMatcher( final NodeMatcher left, final NodeMatcher right ); boolean matches( final MatcherContext context, final ReportElement node ); String toString();  }