@Override
    public String processDoc(String doc) {

        for (int i=0 ; i<regexes.size(); i++) {
            doc = regexes.get(i).matcher(doc).replaceAll(replacements.get(i));
        }

        return doc;
    }
@Test
    public void testOrder() {
        String doc = "sample document";
        ArrayList<String> replacements = new ArrayList<String>();
        replacements.add("*");
        replacements.add("");
        ArrayList<String> regexStrings = new ArrayList<String>();
        regexStrings.add("[!A-Za-z]");
        regexStrings.add("[\\p{Punct}]");
        RegexPreprocessor regexPreprocessor = new RegexPreprocessor(regexStrings, replacements);
        assertEquals(" ", regexPreprocessor.processDoc(doc));

    }