### Question:
ESProxyFilter implements Filter { @Override public void init(FilterConfig filterConfig) throws ServletException { useStatsClient = !SearchUtils.isBlank(filterConfig.getInitParameter(CFG_USE_STATS_CLIENT)); proxyClient = HttpClients.custom().build(); }  @Override void init(FilterConfig filterConfig); @Override void destroy(); @Override void doFilter(ServletRequest request, ServletResponse response, FilterChain chain);  }### Answer:
@Test public void init() throws ServletException { ESProxyFilter tested = getTested(); FilterConfig filterConfig = Mockito.mock(FilterConfig.class); Mockito.when(filterConfig.getInitParameter(ESProxyFilter.CFG_USE_STATS_CLIENT)).thenReturn(null); tested.init(filterConfig); Assert.assertFalse(tested.useStatsClient); Assert.assertNotNull(tested.proxyClient); Mockito.verify(filterConfig).getInitParameter(ESProxyFilter.CFG_USE_STATS_CLIENT); tested.destroy(); Assert.assertNull(tested.proxyClient); Mockito.reset(filterConfig); Mockito.when(filterConfig.getInitParameter(ESProxyFilter.CFG_USE_STATS_CLIENT)).thenReturn(""); tested.init(filterConfig); Assert.assertFalse(tested.useStatsClient); tested.destroy(); Mockito.reset(filterConfig); Mockito.when(filterConfig.getInitParameter(ESProxyFilter.CFG_USE_STATS_CLIENT)).thenReturn(" "); tested.init(filterConfig); Assert.assertFalse(tested.useStatsClient); tested.destroy(); Mockito.reset(filterConfig); Mockito.when(filterConfig.getInitParameter(ESProxyFilter.CFG_USE_STATS_CLIENT)).thenReturn("yes"); tested.init(filterConfig); Assert.assertTrue(tested.useStatsClient); tested.destroy(); Mockito.reset(filterConfig); Mockito.when(filterConfig.getInitParameter(ESProxyFilter.CFG_USE_STATS_CLIENT)).thenReturn("true"); tested.init(filterConfig); Assert.assertTrue(tested.useStatsClient); tested.destroy(); }