| 1791 | * @see #plus(TimeSpan) |
| 1792 | */ |
| 1793 | public List<Duration<U>> union(TimeSpan<? extends U> timespan) { |
| 1794 | |
| 1795 | Duration<U> merged = merge(this, timespan); |
| 1796 | |
| 1797 | if (merged == null) { |
| 1798 | List<Duration<U>> result = new ArrayList<>(); |
| 1799 | result.add(this); |
| 1800 | Duration<U> empty = ofZero(); |
| 1801 | Duration<U> other = empty.plus(timespan); |
| 1802 | result.add(other); |
| 1803 | return Collections.unmodifiableList(result); |
| 1804 | } |
| 1805 | |
| 1806 | return Collections.singletonList(merged); |
| 1807 | |
| 1808 | } |
| 1809 | |
| 1810 | /** |
| 1811 | * <p>Creates a composition of a calendar period and a clock period. </p> |