MatchRule { public static MatchRule withPattern(String pattern) { return new MatchRule(pattern); } private  MatchRule(String regex); static MatchRule withPattern(String pattern); static MatchRule withPatternFromText(String matchDescription); boolean matches(Transaction transaction); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }
@Test public void withPattern() { MatchRule matchRule = MatchRule.withPattern("abc"); assertNotNull(matchRule); assertEquals("abc", matchRule.getPattern()); assertEquals("MatchRule{pattern=abc}", matchRule.toString()); }