### Question:
LoadBalancingPluginLoader { public static LoadBalancingProcessor load( TopologyService topologyService, LeaderLocator leaderLocator, LogProvider logProvider, Config config ) throws Throwable { LoadBalancingPlugin plugin = findPlugin( config ); plugin.init( topologyService, leaderLocator, logProvider, config ); if ( config.get( CausalClusteringSettings.load_balancing_shuffle ) ) { return new ServerShufflingProcessor( plugin ); } return plugin; } private  LoadBalancingPluginLoader(); static void validate( Config config, Log log ); static LoadBalancingProcessor load( TopologyService topologyService, LeaderLocator leaderLocator,
            LogProvider logProvider, Config config );  }### Answer:
@Test public void shouldReturnSelectedPlugin() throws Throwable { Config config = Config.builder() .withSetting( CausalClusteringSettings.load_balancing_plugin, DUMMY_PLUGIN_NAME ) .withSetting( CausalClusteringSettings.load_balancing_shuffle, "false" ).build(); LoadBalancingProcessor plugin = LoadBalancingPluginLoader.load( mock( TopologyService.class ), mock( LeaderLocator.class ), NullLogProvider.getInstance(), config ); assertTrue( plugin instanceof DummyLoadBalancingPlugin ); assertEquals( DUMMY_PLUGIN_NAME, ((DummyLoadBalancingPlugin) plugin).pluginName() ); assertTrue( ((DummyLoadBalancingPlugin) plugin).wasInitialized ); }
@Test public void shouldEnableShufflingOfDelegate() throws Throwable { Config config = Config.builder() .withSetting( CausalClusteringSettings.load_balancing_plugin, DUMMY_PLUGIN_NAME ) .withSetting( CausalClusteringSettings.load_balancing_shuffle, "true" ).build(); LoadBalancingProcessor plugin = LoadBalancingPluginLoader.load( mock( TopologyService.class ), mock( LeaderLocator.class ), NullLogProvider.getInstance(), config ); assertTrue( plugin instanceof ServerShufflingProcessor ); assertTrue( ((ServerShufflingProcessor) plugin).delegate() instanceof DummyLoadBalancingPlugin ); }
@Test public void shouldFindServerPoliciesPlugin() throws Throwable { Config config = Config.builder() .withSetting( CausalClusteringSettings.load_balancing_plugin, ServerPoliciesPlugin.PLUGIN_NAME ) .withSetting( CausalClusteringSettings.load_balancing_shuffle, "false" ).build(); LoadBalancingProcessor plugin = LoadBalancingPluginLoader.load( mock( TopologyService.class ), mock( LeaderLocator.class ), NullLogProvider.getInstance(), config ); assertTrue( plugin instanceof ServerPoliciesPlugin ); assertEquals( ServerPoliciesPlugin.PLUGIN_NAME, ((ServerPoliciesPlugin) plugin).pluginName() ); }