@Test void serviceShouldUnescapeLineBreak() throws Exception { List<ReplacingPattern> patternsFromString = testee.getPatternsFromString("/a/\\\\n/i/"); assertThat(patternsFromString).containsOnly(new ReplacingPattern(Pattern.compile("a"), false, "\\\n")); }
public List<ReplacingPattern> getPatternsFromString(String pattern) throws MailetException { String trimPattern = pattern.trim(); assertPatternSurroundedWithSlashes(trimPattern); ImmutableList.Builder<ReplacingPattern> patternList = ImmutableList.builder(); for (String aPatternArray : extractPatternParts(trimPattern)) { patternList.add(stripSurroundingSlashes(aPatternArray)); } return patternList.build(); }
PatternExtractor { public List<ReplacingPattern> getPatternsFromString(String pattern) throws MailetException { String trimPattern = pattern.trim(); assertPatternSurroundedWithSlashes(trimPattern); ImmutableList.Builder<ReplacingPattern> patternList = ImmutableList.builder(); for (String aPatternArray : extractPatternParts(trimPattern)) { patternList.add(stripSurroundingSlashes(aPatternArray)); } return patternList.build(); } }
PatternExtractor { public List<ReplacingPattern> getPatternsFromString(String pattern) throws MailetException { String trimPattern = pattern.trim(); assertPatternSurroundedWithSlashes(trimPattern); ImmutableList.Builder<ReplacingPattern> patternList = ImmutableList.builder(); for (String aPatternArray : extractPatternParts(trimPattern)) { patternList.add(stripSurroundingSlashes(aPatternArray)); } return patternList.build(); }  }
PatternExtractor { public List<ReplacingPattern> getPatternsFromString(String pattern) throws MailetException { String trimPattern = pattern.trim(); assertPatternSurroundedWithSlashes(trimPattern); ImmutableList.Builder<ReplacingPattern> patternList = ImmutableList.builder(); for (String aPatternArray : extractPatternParts(trimPattern)) { patternList.add(stripSurroundingSlashes(aPatternArray)); } return patternList.build(); }  List<ReplacingPattern> getPatternsFromString(String pattern); List<ReplacingPattern> getPatternsFromFileList(String filepar); }
PatternExtractor { public List<ReplacingPattern> getPatternsFromString(String pattern) throws MailetException { String trimPattern = pattern.trim(); assertPatternSurroundedWithSlashes(trimPattern); ImmutableList.Builder<ReplacingPattern> patternList = ImmutableList.builder(); for (String aPatternArray : extractPatternParts(trimPattern)) { patternList.add(stripSurroundingSlashes(aPatternArray)); } return patternList.build(); }  List<ReplacingPattern> getPatternsFromString(String pattern); List<ReplacingPattern> getPatternsFromFileList(String filepar);  }