@Test
public void testGetOptionalLongFromInput() {

    Map<String, Object> input = new HashMap<String, Object>();
    input.put("key1", new Long(123));
    input.put("key2", "string");
    Map<String, Object> error = new HashMap<String, Object>();
    int defaultValue = 112;
    Assert.assertEquals(new Long(123), listener.getOptionalLongFromInput(input, "key1", defaultValue, error));
    Assert.assertEquals(0, error.size());
    Assert.assertEquals(null, listener.getLongFromInput(input, "key2", error));
    Assert.assertEquals(2, error.size());
    error.clear();
    Assert.assertEquals(new Long(defaultValue), listener.getOptionalLongFromInput(input, "key3", defaultValue, error));
    Assert.assertEquals(0, error.size());
}