@Test
public void testParseBoolean() {

    Properties properties;
    final String param = "param";
    final boolean defaultValue = true;
    // Test valid required param
    try {
        properties = new Properties();
        properties.put(param, Boolean.toString(defaultValue));
        final boolean b = ConfigParser.parseBoolean(properties, param);
        assertEquals(defaultValue, b);
    } catch (final ExitException e) {
        fail("value is valid");
    }
    // Test invalid required param
    try {
        properties = new Properties();
        properties.put(param, "invalid boolean");
        ConfigParser.parseBoolean(properties, param);
    } catch (final ExitException e) {
        ; // Correct behavior
    }
    // Test valid not required param
    try {
        properties = new Properties();
        properties.put(param, Boolean.toString(!defaultValue));
        final boolean b = ConfigParser.parseBoolean(properties, param, defaultValue);
        assertEquals(defaultValue, !b);
    } catch (final ExitException e) {
        fail("value is valid");
    }
    // Test invalid not required param
    try {
        properties = new Properties();
        properties.put(param, "invalid boolean");
        final boolean b = ConfigParser.parseBoolean(properties, param, defaultValue);
        assertEquals(defaultValue, b);
    } catch (final ExitException e) {
        fail("default value is provided");
    }
}