@Test void testRetrieveTokenReplacingPattern() { ReplacingService replacingService = new ReplacingServiceImpl(); assertEquals( Pair.of("(?<=[\\.\\s\\r\\n])01(?=[\\.\\s\\r\\n])", "05"), replacingService.retrieveTokenReplacingPattern("01 BY 05")); assertEquals(Pair.of("", ""), replacingService.retrieveTokenReplacingPattern("")); assertEquals( Pair.of("(?<=[\\.\\s\\r\\n])IDENTIFICATION(?=[\\.\\s\\r\\n])", "DIVISION"), replacingService.retrieveTokenReplacingPattern("IDENTIFICATION by DIVISION")); assertEquals( Pair.of("(?<=[\\.\\s\\r\\n])A(?=[\\.\\s\\r\\n])", "B"), replacingService.retrieveTokenReplacingPattern("\r\nA bY \r\n B ")); }
@Nonnull @Override public Pair<String, String> retrieveTokenReplacingPattern(@Nonnull String clause) { String[] pattern = retrievePattern(clause); return isPatternCorrect(pattern) ? Pair.of(getPatternForFullTokens(pattern[0]), getReplacementPattern(pattern[1])) : Pair.of("", ""); }
ReplacingServiceImpl implements ReplacingService { @Nonnull @Override public Pair<String, String> retrieveTokenReplacingPattern(@Nonnull String clause) { String[] pattern = retrievePattern(clause); return isPatternCorrect(pattern) ? Pair.of(getPatternForFullTokens(pattern[0]), getReplacementPattern(pattern[1])) : Pair.of("", ""); } }
ReplacingServiceImpl implements ReplacingService { @Nonnull @Override public Pair<String, String> retrieveTokenReplacingPattern(@Nonnull String clause) { String[] pattern = retrievePattern(clause); return isPatternCorrect(pattern) ? Pair.of(getPatternForFullTokens(pattern[0]), getReplacementPattern(pattern[1])) : Pair.of("", ""); }  }
ReplacingServiceImpl implements ReplacingService { @Nonnull @Override public Pair<String, String> retrieveTokenReplacingPattern(@Nonnull String clause) { String[] pattern = retrievePattern(clause); return isPatternCorrect(pattern) ? Pair.of(getPatternForFullTokens(pattern[0]), getReplacementPattern(pattern[1])) : Pair.of("", ""); }  @Nonnull String applyReplacing(
      @Nonnull String text, @Nonnull List<Pair<String, String>> replacePatterns); @Nonnull @Override Pair<String, String> retrievePseudoTextReplacingPattern(@Nonnull String clause); @Nonnull @Override Pair<String, String> retrieveTokenReplacingPattern(@Nonnull String clause); }
ReplacingServiceImpl implements ReplacingService { @Nonnull @Override public Pair<String, String> retrieveTokenReplacingPattern(@Nonnull String clause) { String[] pattern = retrievePattern(clause); return isPatternCorrect(pattern) ? Pair.of(getPatternForFullTokens(pattern[0]), getReplacementPattern(pattern[1])) : Pair.of("", ""); }  @Nonnull String applyReplacing(
      @Nonnull String text, @Nonnull List<Pair<String, String>> replacePatterns); @Nonnull @Override Pair<String, String> retrievePseudoTextReplacingPattern(@Nonnull String clause); @Nonnull @Override Pair<String, String> retrieveTokenReplacingPattern(@Nonnull String clause);  }