1750 |
|
} |
1751 |
|
} |
1752 |
|
|
1753 |
< |
void assertImmutable(final Object o) { |
1753 |
> |
void assertImmutable(Object o) { |
1754 |
|
if (o instanceof Collection) { |
1755 |
|
assertThrows( |
1756 |
|
UnsupportedOperationException.class, |
1757 |
< |
new Runnable() { public void run() { |
1758 |
< |
((Collection) o).add(null);}}); |
1757 |
> |
() -> ((Collection) o).add(null)); |
1758 |
|
} |
1759 |
|
} |
1760 |
|
|
1814 |
|
} |
1815 |
|
|
1816 |
|
public void assertThrows(Class<? extends Throwable> expectedExceptionClass, |
1817 |
< |
Runnable... throwingActions) { |
1818 |
< |
for (Runnable throwingAction : throwingActions) { |
1817 |
> |
Action... throwingActions) { |
1818 |
> |
for (Action throwingAction : throwingActions) { |
1819 |
|
boolean threw = false; |
1820 |
|
try { throwingAction.run(); } |
1821 |
|
catch (Throwable t) { |