AlternateFreeRegexFileMatcher implements AlternateFileMatcher { public boolean matches(@NotNull String filename) { return names.contains(filename); } AlternateFreeRegexFileMatcher(String currentFilename, AlternateConfiguration configuration); boolean canProcess(); boolean matches(@NotNull String filename); @NotNull String getBaseFilename(@NotNull String filename);  }
@Test public void testMatches() throws Exception { AlternateConfiguration configuration = new AlternateConfiguration(); configuration.freeRegexActive = true; configuration.genericRegexActive = false; configuration.freeRegexItems.clear(); configuration.freeRegexItems.add(AlternateFreeRegexItem.of("^(.*?)\\.java$", "$1Test.java")); configuration.freeRegexItems.add(AlternateFreeRegexItem.of("^(.*?)\\.java$", "$1.properties")); configuration.freeRegexItems.add(AlternateFreeRegexItem.of("^(.*?)Test\\.java", "$1.java")); configuration.freeRegexItems.add(AlternateFreeRegexItem.of("^(.*?)\\.properties", "$1.java")); assertArrayEquals(new Object[]{ "|MyClass.properties", "|MyClassTest.java", }, getMatchList(new AlternateFreeRegexFileMatcher("MyClass.java", configuration))); assertArrayEquals(new Object[]{ "|MyClass.java", }, getMatchList(new AlternateFreeRegexFileMatcher("MyClass.properties", configuration))); assertArrayEquals(new Object[]{ "|MyClass.java", "|MyClassTest.properties", }, getMatchList(new AlternateFreeRegexFileMatcher("MyClassTest.java", configuration))); }