public void testClose()
{
assertFalse(Safe.close(null));
assertTrue(Safe.close(new ByteArrayOutputStream()));
assertFalse(Safe.close(new Closeable()
{
public void close() throws IOException
{
throw new IOException();
}
}));
assertFalse(Safe.close(new Closeable()
{
public void close() throws IOException
{
throw new RuntimeException();
}
}));
final Error expectedError = new Error();
try
{
Safe.close(new Closeable()
{
public void close() throws IOException
{
throw expectedError;
}