### Question:
RateLimiterServiceImpl implements RateLimiterService { private static String getPreferredProvider() { ClassLoader classLoader = ContextUtils.getClassLoader(); InputStream inStream = classLoader.getResourceAsStream(s_providerPropFilePath); String provider = null; if (inStream != null) { Properties properties = new Properties(); try { properties.load(inStream); provider = (String)properties.get(s_providerPropKey); } catch (IOException e) { } finally { try { inStream.close(); } catch (IOException e) { } } } return provider.trim(); }  @Override IsRateLimitedResponse isRateLimited(IsRateLimitedRequest rateLimiterRequest);  }### Answer:
@Test public void testGetPreferredProvider() { try { Method declaredMethod = RateLimiterServiceImpl.class.getDeclaredMethod("getPreferredProvider",null); declaredMethod.setAccessible(true); String preferredProvider = (String) declaredMethod.invoke(new RateLimiterServiceImpl(), null); assertNotNull(preferredProvider); assertEquals("rateLimiterProviderImpl", preferredProvider.trim()); assertEquals("rateLimiterProviderImpl", preferredProvider); } catch (Exception e) { fail("cannot achive method" + e.getMessage()); } }