@Override
  public void execute(SensorContext context) {
    FilePredicates p = context.fileSystem().predicates();
    List<InputFile> sourceFiles = StreamSupport.stream(
      context.fileSystem().inputFiles(
        p.and(
          p.hasType(InputFile.Type.MAIN),
          p.hasLanguage("java")
        )
      ).spliterator(), false)
      .filter(f -> !((DefaultInputFile) f).isExcludedForDuplication())
      .toList();
    if (sourceFiles.isEmpty()) {
      return;
    }
    createIndex(sourceFiles);
  }
@Test
  public void testExclusions() {
    file.setExcludedForDuplication(true);
    new JavaCpdBlockIndexerSensor(index).execute(context);
    verifyNoInteractions(index);
  }