### Question:
RuntimeConfig implements Config { @Override public EntityListenerProvider getEntityListenerProvider() { EntityListenerProvider provider = config.getEntityListenerProvider(); if (provider == null) { throw new ConfigException(config.getClass().getName(), "getEntityListenerProvider"); } return provider; } RuntimeConfig(Config originalConfig);  RuntimeConfig(Config config, DataSource dataSource); @Override DataSource getDataSource(); @Override String getDataSourceName(); @Override Dialect getDialect(); @Override SqlFileRepository getSqlFileRepository(); @Override ScriptFileLoader getScriptFileLoader(); @Override JdbcLogger getJdbcLogger(); @Override RequiresNewController getRequiresNewController(); @Override ClassHelper getClassHelper(); @Override CommandImplementors getCommandImplementors(); @Override QueryImplementors getQueryImplementors(); @Override SqlLogType getExceptionSqlLogType(); @Override UnknownColumnHandler getUnknownColumnHandler(); @Override TransactionManager getTransactionManager(); @Override Commenter getCommenter(); @Override Naming getNaming(); @Override MapKeyNaming getMapKeyNaming(); @Override int getFetchSize(); @Override int getMaxRows(); @Override int getQueryTimeout(); @Override int getBatchSize(); @Override EntityListenerProvider getEntityListenerProvider();  }### Answer:
@Test public void testGetEntityListener() { Config originalConfig = new MockConfig() { @Override public EntityListenerProvider getEntityListenerProvider() { return new EntityListenerProvider() {}; } }; RuntimeConfig runtimeConfig = new RuntimeConfig(originalConfig); MockEntityListener entityListener = runtimeConfig .getEntityListenerProvider() .get(MockEntityListener.class, MockEntityListener::new); assertNotNull(entityListener); }
@Test public void testGetEntityListenerNullCheck() { Config originalConfig = new MockConfig() { @Override public EntityListenerProvider getEntityListenerProvider() { return null; } }; RuntimeConfig runtimeConfig = new RuntimeConfig(originalConfig); try { runtimeConfig .getEntityListenerProvider() .get(MockEntityListener.class, MockEntityListener::new); fail(); } catch (ConfigException e) { assertEquals("getEntityListenerProvider", e.getMethodName()); } }