public boolean isIncluded(Path absolutePath, Path relativePath, InputFile.Type type) {
    PathPattern[] inclusionPatterns = InputFile.Type.MAIN == type ? mainInclusionsPattern : testInclusionsPattern;

    if (inclusionPatterns.length == 0) {
      return true;
    }

    for (PathPattern pattern : inclusionPatterns) {
      if (pattern.match(absolutePath, relativePath)) {
        return true;
      }
    }

    return false;
  }
@Test
  public void should_handleAliasForTestInclusionsProperty() {
    settings.setProperty(PROJECT_TESTS_INCLUSIONS_PROPERTY, "**/*Dao.java");
    AbstractExclusionFilters filter = new AbstractExclusionFilters(analysisWarnings, settings.asConfig()::getStringArray) {
    };

    IndexedFile indexedFile = new DefaultIndexedFile("foo", moduleBaseDir, "test/main/java/com/mycompany/FooDao.java", null);
    assertThat(filter.isIncluded(indexedFile.path(), Paths.get(indexedFile.relativePath()), InputFile.Type.TEST)).isTrue();

    indexedFile = new DefaultIndexedFile("foo", moduleBaseDir, "test/main/java/com/mycompany/Foo.java", null);
    assertThat(filter.isIncluded(indexedFile.path(), Paths.get(indexedFile.relativePath()), InputFile.Type.TEST)).isFalse();

    String expectedWarn = "Use of sonar.tests.inclusions detected. " +
      "While being taken into account, the only supported property is sonar.test.inclusions. Consider updating your configuration.";
    assertThat(logTester.logs(Level.WARN)).hasSize(1)
      .contains(expectedWarn);
    verify(analysisWarnings).addUnique(expectedWarn);
  }