protected List<String> prepareContents(String contents) {
        final Pattern pattern = Pattern.compile(";");
        return Arrays.stream(contents.split("\n"))
                .map(r -> r.indexOf("#") > 0 ? r.substring(0, r.indexOf("#")) : r)
                .flatMap(pattern::splitAsStream)
                .map(String::trim)
                .filter(r -> r.startsWith("requires"))
                .collect(toCollection(ArrayList::new));
    }
@Test
    @SuppressWarnings("unchecked")
    public void testPrepareContent() {
        PerlCpanfileAnalyzer instance = new PerlCpanfileAnalyzer();
        String content = "requires 'JSON'; #any version";
        List<String> expResult = Arrays.asList(new String[]{"requires 'JSON'"});
        List<String> result = instance.prepareContents(content);
        assertEquals(expResult, result);

        content = "requires 'JSON'; requires 'XML';";
        expResult = Arrays.asList(new String[]{"requires 'JSON'", "requires 'XML'"});
        result = instance.prepareContents(content);
        assertEquals(expResult, result);
        content = "requires 'JSON';\n     requires 'XML';";
        expResult = Arrays.asList(new String[]{"requires 'JSON'", "requires 'XML'"});
        result = instance.prepareContents(content);
        assertEquals(expResult, result);

        content = "requires 'JSON';# requires 'XML';";
        expResult = Arrays.asList(new String[]{"requires 'JSON'"});
        result = instance.prepareContents(content);
        assertEquals(expResult, result);
    }