@Test
public void testValidatePagingParameter()
{

    // Happy path.
    assertEquals(INTEGER_VALUE, businessObjectDataSearchHelper.validatePagingParameter(PARAMETER_NAME, INTEGER_VALUE, null, Integer.MAX_VALUE));
    // Test the default value assignment.
    assertEquals(INTEGER_VALUE_2, businessObjectDataSearchHelper.validatePagingParameter(PARAMETER_NAME, null, INTEGER_VALUE_2, Integer.MAX_VALUE));
    // Try to validate a parameter value that is less than 1.
    try
    {
        businessObjectDataSearchHelper.validatePagingParameter(PARAMETER_NAME, 0, null, Integer.MAX_VALUE);
        fail();
    }
    catch (IllegalArgumentException e)
    {
        assertEquals(String.format("A %s greater than 0 must be specified.", PARAMETER_NAME), e.getMessage());
    }
    // Try to validate a parameter value that is greater than the specified max value.
    try
    {
        businessObjectDataSearchHelper.validatePagingParameter(PARAMETER_NAME, Integer.MAX_VALUE, null, Integer.MAX_VALUE - 1);
        fail();
    }
    catch (IllegalArgumentException e)
    {
        assertEquals(String.format("A %s less than %d must be specified.", PARAMETER_NAME, Integer.MAX_VALUE - 1), e.getMessage());
    }
}