public ImmutableList<PluginMatchingResult<VulnDetector>> getVulnDetectors(
      ReconnaissanceReport reconnaissanceReport) {
    return tsunamiPlugins.entrySet().stream()
        .filter(entry -> isVulnDetector(entry.getKey()))
        .map(entry -> matchAllVulnDetectors(entry.getKey(), entry.getValue(), reconnaissanceReport))
        .flatMap(Streams::stream)
        .collect(toImmutableList());
  }
@Test
  public void getVulnDetectors_whenOsServiceFilterHasMatchingClass_returnsMatches() {
    NetworkService wordPressService =
        NetworkService.newBuilder()
            .setNetworkEndpoint(NetworkEndpointUtils.forIpAndPort("1.1.1.1", 80))
            .setTransportProtocol(TransportProtocol.TCP)
            .setServiceName("http")
            .setSoftware(Software.newBuilder().setName("WordPress"))
            .build();
    NetworkService jenkinsService =
        NetworkService.newBuilder()
            .setNetworkEndpoint(NetworkEndpointUtils.forIpAndPort("1.1.1.1", 443))
            .setTransportProtocol(TransportProtocol.TCP)
            .setServiceName("https")
            .setSoftware(Software.newBuilder().setName("Jenkins"))
            .build();
    NetworkService noNameService =
        NetworkService.newBuilder()
            .setNetworkEndpoint(NetworkEndpointUtils.forIpAndPort("1.1.1.1", 12345))
            .setTransportProtocol(TransportProtocol.TCP)
            .build();
    ReconnaissanceReport fakeReconnaissanceReport =
        ReconnaissanceReport.newBuilder()
            .setTargetInfo(
                TargetInfo.newBuilder()
                    .addOperatingSystemClasses(
                        OperatingSystemClass.newBuilder()
                            .setVendor("Vendor")
                            .setOsFamily("FakeOS")
                            .setAccuracy(99)))
            .addNetworkServices(wordPressService)
            .addNetworkServices(jenkinsService)
            .addNetworkServices(noNameService)
            .build();
    PluginManager pluginManager =
        Guice.createInjector(
                new FakePortScannerBootstrapModule(),
                new FakeServiceFingerprinterBootstrapModule(),
                FakeOsServiceFilteringDetector.getModule())
            .getInstance(PluginManager.class);

    ImmutableList<PluginMatchingResult<VulnDetector>> vulnDetectors =
        pluginManager.getVulnDetectors(fakeReconnaissanceReport);

    assertThat(vulnDetectors).hasSize(1);
    assertThat(vulnDetectors.get(0).tsunamiPlugin().getClass())
        .isEqualTo(FakeOsServiceFilteringDetector.class);
    // And matches the ones with the Jenkins software (and noname as well, as no software info is
    // present there; see hasMatchingServiceName)
    assertThat(vulnDetectors.get(0).matchedServices())
        .containsExactly(jenkinsService, noNameService);
  }