### Question:
Optimizer { static Matcher inlineMatchAnyPrecedingOr(Matcher matcher) { if (matcher instanceof ZeroOrMoreMatcher) { ZeroOrMoreMatcher zm = matcher.as(); if (zm.repeated() instanceof AnyMatcher && zm.next() instanceof OrMatcher) { List<Matcher> matchers = zm.next().<OrMatcher>as().matchers(); List<Matcher> ms = new ArrayList<>(); for (Matcher m : matchers) { ms.add(new ZeroOrMoreMatcher(AnyMatcher.INSTANCE, m)); } return OrMatcher.create(ms); } } return matcher; } private  Optimizer();   }### Answer:
@Test public void inlineMatchAnyPrecedingOr() { Matcher a = new CharSeqMatcher("a"); Matcher b = new CharSeqMatcher("b"); Matcher input = new ZeroOrMoreMatcher( AnyMatcher.INSTANCE, OrMatcher.create(a, b) ); Matcher expected = OrMatcher.create( new ZeroOrMoreMatcher(AnyMatcher.INSTANCE, a), new ZeroOrMoreMatcher(AnyMatcher.INSTANCE, b) ); Assertions.assertEquals(expected, Optimizer.inlineMatchAnyPrecedingOr(input)); }