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