ConfigUtils { public static <T> T getOrNull(Config config, String path) { return getOrElse(config, path, null); }  static Config configFromPath(String path); static Config configFromResource(String resource); static Config applySubstitutions(Config config); static Config applySubstitutions(Config config, String substitutionsString); static Config getApplicationConfig(Config config); static Config mergeLoadedConfiguration(Config config); static Config findReplaceStringValues(Config config, String findRegex, Object replace); static boolean canBeCoerced(Config config, String path, ConfigValueType type); static T getOrElse(Config config, String path, T orElse); static T getOrNull(Config config, String path); static final String JAR_FILE_EXCEPTION_MESSAGE; }
@Test public void getOrNullExists() { Config config = ConfigFactory.empty().withValue("hello", ConfigValueFactory.fromAnyRef(true)); assertEquals(true, ConfigUtils.getOrNull(config, "hello")); }
@Test public void getOrNullNotExists() { Config config = ConfigFactory.empty(); assertNull(ConfigUtils.getOrNull(config, "hello")); }