### Question:
KVUtils { public static boolean getBooleanValue(KVPairs kv, boolean defaultValue, String... keys) { String v = findFirstNonEmptyValue(kv, keys); return v == null ? defaultValue : TRUE_STR_VALUES.contains(v.toLowerCase()); }  static String getValue(KVPairs kv, String defaultValue, String... keys); static Long getLongValue(KVPairs kv, Long defaultValue, String... keys); static boolean getBooleanValue(KVPairs kv, boolean defaultValue, String... keys); static Optional<String> getValueOpt(KVPairs kv, String key);  }### Answer:
@Test public void getBooleanValue() { kv.add("foo", "true"); kv.add("toto", "0"); assertTrue("primary key", KVUtils.getBooleanValue(kv, false, "foo", "toto")); assertFalse("secondary key", KVUtils.getBooleanValue(kv, true, "bogus", "toto")); assertTrue("default value", KVUtils.getBooleanValue(kv, true, "bogus", "bogus_too")); }
@Test public void getBooleanValue_UseDefaultIfEmpty() { kv.add("foo", ""); assertTrue(KVUtils.getBooleanValue(kv, true, "foo")); }