@Test public void testAutoCloseableCollection() { final List<MyAutoCloseable> list = Arrays.asList(new MyAutoCloseable(), new MyAutoCloseable()); CloseUtils.closeQuietly(list); assertTrue(list.get(0).closed); assertTrue(list.get(1).closed); }
@SuppressWarnings("rawtypes") public static void closeQuietly(final Collection objs) { for (final Object obj : objs) { closeQuietly(obj); } }
CloseUtils { @SuppressWarnings("rawtypes") public static void closeQuietly(final Collection objs) { for (final Object obj : objs) { closeQuietly(obj); } } }
CloseUtils { @SuppressWarnings("rawtypes") public static void closeQuietly(final Collection objs) { for (final Object obj : objs) { closeQuietly(obj); } } CloseUtils(); }
CloseUtils { @SuppressWarnings("rawtypes") public static void closeQuietly(final Collection objs) { for (final Object obj : objs) { closeQuietly(obj); } } CloseUtils(); @SuppressWarnings("rawtypes") static void closeQuietly(final Collection objs); static void closeQuietly(final Object obj); }
CloseUtils { @SuppressWarnings("rawtypes") public static void closeQuietly(final Collection objs) { for (final Object obj : objs) { closeQuietly(obj); } } CloseUtils(); @SuppressWarnings("rawtypes") static void closeQuietly(final Collection objs); static void closeQuietly(final Object obj);  }