InitParameterExtractor implements HasKeys<String> { @SuppressWarnings("unchecked") @Override public Enumeration<String> getKeys() { return context.getInitParameterNames(); } InitParameterExtractor(ServletContext context); @SuppressWarnings("unchecked") @Override Enumeration<String> getKeys(); @Override String getValue(String key);  }
@SuppressWarnings("unchecked") @Test public void testGetKeys() { Enumeration<String> keys = createMock(Enumeration.class); expect(context.getInitParameterNames()).andReturn(keys); replay(context, keys); assertEquals(keys, extractor.getKeys()); verify(context, keys); }