public Optional<PluginMatchingResult<ServiceFingerprinter>> getServiceFingerprinter(
      NetworkService networkService) {
    return tsunamiPlugins.entrySet().stream()
        .filter(entry -> entry.getKey().type().equals(PluginType.SERVICE_FINGERPRINT))
        .filter(entry -> hasMatchingServiceName(networkService, entry.getKey()))
        .map(
            entry ->
                PluginMatchingResult.<ServiceFingerprinter>builder()
                    .setPluginDefinition(entry.getKey())
                    .setTsunamiPlugin((ServiceFingerprinter) entry.getValue().get())
                    .addMatchedService(networkService)
                    .build())
        .findFirst();
  }
@Test
  public void getServiceFingerprinter_whenForWebServiceAnnotationAndWebService_returnsMatch() {
    NetworkService httpProxyService =
        NetworkService.newBuilder()
            .setNetworkEndpoint(NetworkEndpointUtils.forIpAndPort("1.1.1.1", 80))
            .setTransportProtocol(TransportProtocol.TCP)
            .setServiceName("http-proxy")
            .build();
    NetworkService httpsService =
        NetworkService.newBuilder()
            .setNetworkEndpoint(NetworkEndpointUtils.forIpAndPort("1.1.1.1", 80))
            .setTransportProtocol(TransportProtocol.TCP)
            .setServiceName("https")
            .build();
    PluginManager pluginManager =
        Guice.createInjector(new FakePortScannerBootstrapModule(), FakeWebFingerprinter.getModule())
            .getInstance(PluginManager.class);

    Optional<PluginMatchingResult<ServiceFingerprinter>> fingerprinter =
        pluginManager.getServiceFingerprinter(httpsService);
    assertThat(fingerprinter).isPresent();
    assertThat(fingerprinter.get().matchedServices()).containsExactly(httpsService);

    fingerprinter = pluginManager.getServiceFingerprinter(httpProxyService);
    assertThat(fingerprinter).isPresent();
    assertThat(fingerprinter.get().matchedServices()).containsExactly(httpProxyService);
  }