public Timespan substractWithZeroFloor(Timespan other) {
        if (getTimeUnit() == other.getTimeUnit()) {
            long delta = Math.max(0, getDuration() - other.getDuration());
            return new Timespan(delta, getTimeUnit());
        }

        long delta = Math.max(0, getDurationInMilliseconds() - other.getDurationInMilliseconds());

        return new Timespan(delta, TimeUnit.MILLISECOND);
    }
public Timespan substractWithZeroFloor ( Timespan other ) { if ( getTimeUnit ( ) == other . getTimeUnit ( ) ) { long delta = Math . max ( 0 , getDuration ( ) - other . getDuration ( ) ) ; return new Timespan ( delta , getTimeUnit ( ) ) ; } long delta = Math . max ( 0 , getDurationInMilliseconds ( ) - other . getDurationInMilliseconds ( ) ) ; return new Timespan ( delta , TimeUnit . MILLISECOND ) ; }
Creates and returns a new timespan whose duration is {@code this}
timespan's duration minus the {@code other} timespan's duration.
<p>
The time unit is preserved if {@code other} has the same unit
as {@code this}.
<p>
Negative timespans are not supported, so if the {@code other}
timespan duration is greater than {@code this} timespan duration,
a timespan of zero is returned (i.e., a negative timespan is never
returned).

@param other
the timespan to subtract from this one

@return a new timespan representing {@code this - other}