@Test public void matchWhenUsingListConstructor() { OrBlockMatcher matcher = new OrBlockMatcher(Arrays.<BlockMatcher>asList( new ClassBlockMatcher(GroupBlock.class), new ClassBlockMatcher(FormatBlock.class))); Assert.assertTrue(matcher.match(new GroupBlock())); Assert.assertTrue(matcher.match(new FormatBlock(Collections.<Block>emptyList(), Format.BOLD))); Assert.assertFalse(matcher.match(new WordBlock("test"))); }
@Override public boolean match(Block block) { boolean result = false; for (BlockMatcher matcher : this.matchers) { if (matcher.match(block)) { result = true; break; } } return result; }
OrBlockMatcher implements BlockMatcher { @Override public boolean match(Block block) { boolean result = false; for (BlockMatcher matcher : this.matchers) { if (matcher.match(block)) { result = true; break; } } return result; } }
OrBlockMatcher implements BlockMatcher { @Override public boolean match(Block block) { boolean result = false; for (BlockMatcher matcher : this.matchers) { if (matcher.match(block)) { result = true; break; } } return result; } OrBlockMatcher(List<BlockMatcher> matchers);  OrBlockMatcher(BlockMatcher... matchers); }
OrBlockMatcher implements BlockMatcher { @Override public boolean match(Block block) { boolean result = false; for (BlockMatcher matcher : this.matchers) { if (matcher.match(block)) { result = true; break; } } return result; } OrBlockMatcher(List<BlockMatcher> matchers);  OrBlockMatcher(BlockMatcher... matchers); @Override boolean match(Block block); }
OrBlockMatcher implements BlockMatcher { @Override public boolean match(Block block) { boolean result = false; for (BlockMatcher matcher : this.matchers) { if (matcher.match(block)) { result = true; break; } } return result; } OrBlockMatcher(List<BlockMatcher> matchers);  OrBlockMatcher(BlockMatcher... matchers); @Override boolean match(Block block);  }