### Question:
LiquibaseHelper { static void closeQuietly(final EntityManagerFactory emf) { if (emf != null) { try { emf.close(); } catch (final Exception ex) { LOG.warn("Error closing entity manager factory: {}", ex.getMessage(), ex); } } } LiquibaseHelper(final Map<String, String> props);   LiquibaseHelper(
            final Map<String, String> props,
            final ResourceAccessor resourceAccessor,
            final File resourcesDir,
            final String masterChangeLogName); File getResourcesDir(); File getMasterChangeLogFile(); void migrate(); File generateMigrations();  }### Answer:
@Test public void testCloseEntityManagerFactoryNull() { LiquibaseHelper.closeQuietly((EntityManagerFactory) null); }
@Test public void testCloseEntityManagerFactoryException() throws Exception { final EntityManagerFactory emf = mock(EntityManagerFactory.class); doThrow(new RuntimeException("Boom")).when(emf).close(); LiquibaseHelper.closeQuietly(emf); verify(emf).close(); }
@Test public void testCloseDatabaseNull() { LiquibaseHelper.closeQuietly((Database) null); }
@Test public void testCloseDatabaseException() throws Exception { final Database database = mock(Database.class); doThrow(new RuntimeException("Boom")).when(database).close(); LiquibaseHelper.closeQuietly(database); verify(database).close(); }