### Question:
SupportedProtocolCreator { public List<ModifierSupportedProtocols> createSupportedModifierProtocols() { ModifierSupportedProtocols supportedCompression = compressionProtocolVersions(); return Stream.of( supportedCompression ) .filter( supportedProtocols -> !supportedProtocols.versions().isEmpty() ) .collect( Collectors.toList() ); } SupportedProtocolCreator( Config config, LogProvider logProvider ); ApplicationSupportedProtocols createSupportedCatchupProtocol(); ApplicationSupportedProtocols createSupportedRaftProtocol(); List<ModifierSupportedProtocols> createSupportedModifierProtocols();  }### Answer:
@Test public void shouldNotReturnModifiersIfNoVersionsSpecified() { Config config = Config.defaults(); List<ModifierSupportedProtocols> supportedModifierProtocols = new SupportedProtocolCreator( config, log ).createSupportedModifierProtocols(); assertThat( supportedModifierProtocols, empty() ); }
@Test public void shouldReturnACompressionModifierIfCompressionVersionsSpecified() { Config config = Config.defaults( CausalClusteringSettings.compression_implementations, COMPRESSION_SNAPPY.implementation() ); List<ModifierSupportedProtocols> supportedModifierProtocols = new SupportedProtocolCreator( config, log ).createSupportedModifierProtocols(); Stream<Protocol.Category<Protocol.ModifierProtocol>> identifiers = supportedModifierProtocols.stream().map( SupportedProtocols::identifier ); assertThat( identifiers, StreamMatchers.contains( Protocol.ModifierProtocolCategory.COMPRESSION ) ); }
@Test public void shouldReturnCompressionWithVersionsSpecified() { Config config = Config.defaults( CausalClusteringSettings.compression_implementations, COMPRESSION_SNAPPY.implementation() ); List<ModifierSupportedProtocols> supportedModifierProtocols = new SupportedProtocolCreator( config, log ).createSupportedModifierProtocols(); List<String> versions = supportedModifierProtocols.get( 0 ).versions(); assertThat( versions, contains( COMPRESSION_SNAPPY.implementation() ) ); }
@Test public void shouldReturnCompressionWithVersionsSpecifiedCaseInsensitive() { Config config = Config.defaults( CausalClusteringSettings.compression_implementations, COMPRESSION_SNAPPY.implementation().toLowerCase() ); List<ModifierSupportedProtocols> supportedModifierProtocols = new SupportedProtocolCreator( config, log ).createSupportedModifierProtocols(); List<String> versions = supportedModifierProtocols.get( 0 ).versions(); assertThat( versions, contains( COMPRESSION_SNAPPY.implementation() ) ); }