class DurationUnitsProvider extends AbstractUnitsProvider<Duration> {

    @SuppressWarnings("PMD.PreserveStackTrace")
    public void add(Calendar cal, Duration dur)
    {
        try
        {
            dur.addTo(cal);
        }
        catch (ArithmeticException e)
        {
            if (LOGGER.isDebugEnabled())
            {
                LOGGER.debug(e, e);
            }
            Duration adjusted = getLargestIntegerUnitType(dur);
            if (adjusted == null)
            {
                throw new IllegalArgumentException(dur + " cannot be represented as an integer for calendar addition.");
            }
            adjusted.addTo(cal);
        }
    }

    public  DurationUnitsProvider();

}