### Question:
DispatcherFlushRulesImpl implements Preprocessor { protected final Map<Pattern, String[]> configureFlushRules(final Map<String, String> configuredRules) throws Exception { final Map<Pattern, String[]> rules = new LinkedHashMap<Pattern, String[]>(); for (final Map.Entry<String, String> entry : configuredRules.entrySet()) { final Pattern pattern = Pattern.compile(entry.getKey().trim()); rules.put(pattern, entry.getValue().trim().split("&")); } return rules; }  @Override @SuppressWarnings("squid:S3776") final void preprocess(final ReplicationAction replicationAction,
                                 final ReplicationOptions replicationOptions);  }### Answer:
@Test public void testConfigureFlushRules() throws Exception { final Map<String, String> validFlushRules = new LinkedHashMap<String, String>(); validFlushRules.put("/a/.*", "/b"); validFlushRules.put("/b/.*", "/c"); validFlushRules.put("/c/d/.*", "/e/f"); validFlushRules.put("/c/a/.*", "/e/f&/g/h"); final Map<Pattern, String[]> expected = new LinkedHashMap<Pattern, String[]>(); expected.put(Pattern.compile("/a/.*"), new String[] { "/b" }); expected.put(Pattern.compile("/b/.*"), new String[] { "/c" }); expected.put(Pattern.compile("/c/d/.*"), new String[] { "/e/f" }); expected.put(Pattern.compile("/c/a/.*"), new String[] { "/e/f", "/g/h" }); final Map<Pattern, String[]> actual = dispatcherFlushRules.configureFlushRules(validFlushRules); final Pattern[] expectedPatterns = expected.keySet().toArray(new Pattern[0]); final Pattern[] actualPatterns = actual.keySet().toArray(new Pattern[0]); final String[][] expectedValues = expected.values().toArray(new String[0][0]); final String[][] actualValues = actual.values().toArray(new String[0][0]); assertEquals(expected.size(), actual.size()); for(int i = 0; i < expected.size(); i++) { assertEquals(expectedPatterns[i].pattern(), actualPatterns[i].pattern()); } assertArrayEquals(expectedValues, actualValues); }