### Question:
Optimizer { static Matcher removeFalseBranchesFromOr(Matcher matcher) { if (matcher instanceof OrMatcher) { List<Matcher> ms = matcher.<OrMatcher>as() .matchers() .stream() .filter(m -> !(m instanceof FalseMatcher)) .collect(Collectors.toList()); return OrMatcher.create(ms); } return matcher; } private  Optimizer();   }### Answer:
@Test public void removeFalseBranchesFromOr() { Matcher input = OrMatcher.create( new CharSeqMatcher("a"), FalseMatcher.INSTANCE, new CharSeqMatcher("b") ); Matcher expected = OrMatcher.create( new CharSeqMatcher("a"), new CharSeqMatcher("b") ); Assertions.assertEquals(expected, Optimizer.removeFalseBranchesFromOr(input)); }