@Test public void testEntityManagerClosed() { final EntityManager em = mock(EntityManager.class); when(em.isOpen()).thenReturn(false); CloseUtils.closeQuietly(em); verify(em, times(1)).isOpen(); verify(em, never()).close(); }
@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);  }