### Question:
CompressionProviderFactory implements CompressionProviderFactoryInterface { @Override public CompressionProvider createCompressionProviderInstance( String name ) { CompressionProvider provider = null; List<PluginInterface> providers = getPlugins(); if ( providers != null ) { for ( PluginInterface plugin : providers ) { if ( name != null && name.equalsIgnoreCase( plugin.getName() ) ) { try { return PluginRegistry.getInstance().loadClass( plugin, CompressionProvider.class ); } catch ( Exception e ) { provider = null; } } } } return provider; } private  CompressionProviderFactory(); static CompressionProviderFactory getInstance(); @Override CompressionProvider createCompressionProviderInstance( String name ); @Override Collection<CompressionProvider> getCompressionProviders(); @Override String[] getCompressionProviderNames(); @Override CompressionProvider getCompressionProviderByName( String name );  }### Answer:
@Test public void testCreateCoreProviders() { CompressionProvider provider = factory.createCompressionProviderInstance( "None" ); assertNotNull( provider ); assertTrue( provider.getClass().isAssignableFrom( NoneCompressionProvider.class ) ); assertEquals( "None", provider.getName() ); assertEquals( "No compression", provider.getDescription() ); provider = factory.createCompressionProviderInstance( "Zip" ); assertNotNull( provider ); assertTrue( provider.getClass().isAssignableFrom( ZIPCompressionProvider.class ) ); assertEquals( "Zip", provider.getName() ); assertEquals( "ZIP compression", provider.getDescription() ); provider = factory.createCompressionProviderInstance( "GZip" ); assertNotNull( provider ); assertTrue( provider.getClass().isAssignableFrom( GZIPCompressionProvider.class ) ); assertEquals( "GZip", provider.getName() ); assertEquals( "GZIP compression", provider.getDescription() ); provider = factory.createCompressionProviderInstance( "Snappy" ); assertNotNull( provider ); assertTrue( provider.getClass().isAssignableFrom( SnappyCompressionProvider.class ) ); assertEquals( "Snappy", provider.getName() ); assertEquals( "Snappy compression", provider.getDescription() ); provider = factory.createCompressionProviderInstance( "Hadoop-snappy" ); assertNotNull( provider ); assertTrue( provider.getClass().isAssignableFrom( HadoopSnappyCompressionProvider.class ) ); assertEquals( "Hadoop-snappy", provider.getName() ); assertEquals( "Hadoop Snappy compression", provider.getDescription() ); }