1584 |
|
} |
1585 |
|
interface Fun {void f() throws Throwable;} |
1586 |
|
private static void THROWS(Class<? extends Throwable> k, Fun... fs) { |
1587 |
< |
for (Fun f : fs) |
1588 |
< |
try { f.f(); fail("Expected " + k.getName() + " not thrown"); } |
1589 |
< |
catch (Throwable t) { |
1590 |
< |
if (k.isAssignableFrom(t.getClass())) pass(); |
1591 |
< |
else unexpected(t);}} |
1587 |
> |
for (Fun f : fs) |
1588 |
> |
try { f.f(); fail("Expected " + k.getName() + " not thrown"); } |
1589 |
> |
catch (Throwable t) { |
1590 |
> |
if (k.isAssignableFrom(t.getClass())) pass(); |
1591 |
> |
else unexpected(t);}} |
1592 |
|
static byte[] serializedForm(Object obj) { |
1593 |
|
try { |
1594 |
|
ByteArrayOutputStream baos = new ByteArrayOutputStream(); |