@Deprecated
    public static boolean parseBoolean(final String text, final boolean defaultValue) {
        // This methods expects |text| is not null.
        final String textTrimmed = text.trim();

        if ("true".equals(textTrimmed) || "True".equals(textTrimmed)) {
            return true;
        }
        if ("false".equals(textTrimmed) || "False".equals(textTrimmed)) {
            return false;
        }
        if (textTrimmed.length() == 0) {
            return defaultValue;
        }
        if ("null".equals(textTrimmed)) {
            return defaultValue;
        }
        throw new IllegalArgumentException("Only \"true\" or \"false\" is recognized.");
    }
@Test
    public void testParseBoolean() {
        assertBoolean("true", true, false);
        assertBoolean("True", true, false);
        assertBoolean("false", false, false);
        assertBoolean("false", false, false);

        assertBoolean("  true", true, true);
        assertBoolean("  True", true, true);
        assertBoolean(" false  ", false, true);
        assertBoolean(" false  ", false, true);

        assertBoolean("", false, false);
        assertBoolean("", true, true);
        assertBoolean("  ", false, false);
        assertBoolean("  ", true, true);
        assertBoolean("null", false, false);
        assertBoolean("null", true, true);
        assertBoolean(" null  ", false, false);
        assertBoolean(" null  ", true, true);
    }