@SuppressWarnings({ "rawtypes", "unchecked" }) protected static <T extends PulsarConfiguration> T create(Properties properties, Class<? extends PulsarConfiguration> clazz) throws IOException, IllegalArgumentException { checkNotNull(properties); T configuration = null; try { configuration = (T) clazz.newInstance(); configuration.setProperties(properties); update((Map) properties, configuration); } catch (InstantiationException | IllegalAccessException e) { throw new IllegalArgumentException("Failed to instantiate " + clazz.getName(), e); } return configuration; }