Configuration { public static boolean isTrue(String key, boolean defaultVal) { String val = valueFor(key); if (val == null) { return defaultVal; } if ("true|false".indexOf(val) == -1) { XRLog.log(Level.WARNING, LogMessageId.LogMessageId4Param.EXCEPTION_CONFIGURATION_WRONG_TYPE, key, "boolean", val, "boolean"); return defaultVal; } else { return Boolean.valueOf(val).booleanValue(); } } private  Configuration(); static void setConfigLogger(Logger logger); static String valueFor(String key); static boolean hasValue(String key); static int valueAsByte(String key, byte defaultVal); static int valueAsShort(String key, short defaultVal); static int valueAsInt(String key, int defaultVal); static long valueAsLong(String key, long defaultVal); static float valueAsFloat(String key, float defaultVal); static double valueAsDouble(String key, double defaultVal); static String valueFor(String key, String defaultVal); static Iterator<String> keysByPrefix(String prefix); static boolean isTrue(String key, boolean defaultVal); static boolean isFalse(String key, boolean defaultVal); static Object valueFromClassConstant(String key, Object defaultValue);  }
@Test public void testIsTrue() { String key = "xr.test-config-boolean"; boolean value = Configuration.isTrue(key, false); assertThat(value, is(true)); }