HibernateConfiguration extends AbstractConfiguration implements Configuration { @Override public Iterator<String> getKeys() { return getConfiguration().keySet().iterator(); } HibernateConfiguration(final SessionFactory factory,
                                  final String section); @Override boolean isEmpty(); @Override boolean containsKey(final String key); @Override Object getProperty(final String key); @Override void clear(); @Override Iterator<String> getKeys();  }
@Test public void testKeys() { configOne.addProperty("key", "value"); configOne.addProperty("lol", "cat"); List<String> keys = new ArrayList<>(); configOne.getKeys().forEachRemaining(keys::add); assertTrue(keys.contains("key")); assertTrue(keys.contains("lol")); assertEquals(2, keys.size()); }