@Test
public void testParseLong() {

    Properties properties;
    final String param = "param";
    final long defaultValue = Long.MAX_VALUE - 10;
    // Test valid required param
    try {
        properties = new Properties();
        properties.put(param, Long.toString(defaultValue));
        final long l = ConfigParser.parseLong(properties, param);
        assertEquals(defaultValue, l);
    } catch (final ExitException e) {
        fail("value is valid");
    }
    // Test invalid required param
    try {
        properties = new Properties();
        properties.put(param, "invalid long");
        ConfigParser.parseLong(properties, param);
    } catch (final ExitException e) {
        ; // Correct behavior
    }
    // Test valid not required param
    try {
        properties = new Properties();
        properties.put(param, Long.toString(defaultValue + 1));
        final long l = ConfigParser.parseLong(properties, param, defaultValue);
        assertEquals(defaultValue, l - 1);
    } catch (final ExitException e) {
        fail("value is valid");
    }
    // Test invalid not required param
    try {
        properties = new Properties();
        properties.put(param, "invalid long");
        final long l = ConfigParser.parseLong(properties, param, defaultValue);
        assertEquals(defaultValue, l);
    } catch (final ExitException e) {
        fail("default value is provided");
    }
}