### Question:
TableRegisterSupport { public boolean dropTable(@Nonnull final String identifier) { Validate.notNull(conn); final String sql = "DROP TABLE IF EXISTS " + identifier; try (final Statement st = conn.createStatement()) { st.execute(sql); return true; } catch (final SQLException e) { logger.error("Failed to drop tables SQL {}", sql, e); return false; } } TableRegisterSupport(Connection conn, TableRegisterConfiguration configuration);  TableRegisterSupport(Connection conn); protected  TableRegisterSupport(); boolean registerDatabase(String source); boolean registerTable(String source, String tableEntity, ColumnSpec[] feedColumnSpecs, String feedFormatOptions, String targetFormatOptions, ColumnSpec[] partitions, ColumnSpec[]
        columnSpecs, String feedTableProperties, String targetTableProperties, TableType tableType, boolean registerDatabase); boolean registerTable(String source, String tableEntity, ColumnSpec[] feedColumnSpecs, String feedFormatOptions, String targetFormatOptions, ColumnSpec[] partitions, ColumnSpec[]
            columnSpecs, String feedTableProperties, String targetTableProperties, TableType tableType, boolean registerDatabase, String feedTableOverride); Set<String> fetchExisting(String source, String tableEntity); String formatOptionsForType(TableType tableType, String rawSpecification, String targetSpecification); boolean registerStandardTables(String source, String tableEntity, ColumnSpec[] feedColumnSpecs, String feedFormatOptions, String targetFormatOptions, ColumnSpec[] partitions, ColumnSpec[]
        columnSpecs, String feedTblProperties, String targetTblProperties, String feedTblOverride); boolean registerStandardTables(String source, String tableEntity, ColumnSpec[] feedColumnSpecs, String feedFormatOptions, String targetFormatOptions, ColumnSpec[] partitions, ColumnSpec[]
            columnSpecs, String feedTblProperties, String targetTblProperties); boolean dropTable(@Nonnull final String identifier); boolean dropTables(@Nonnull final String source, @Nonnull final String entity, @Nonnull final Set<TableType> tableTypes, @Nonnull final Set<String> additionalTables);  }### Answer:
@Test public void testDropTable() throws Exception { final Statement statement = Mockito.mock(Statement.class); Mockito.when(statement.execute(Mockito.anyString())).then(invocation -> { final String sql = (String) invocation.getArguments()[0]; if (sql.equals("DROP TABLE IF EXISTS `invalid`")) { throw new SQLException(); } return true; }); Mockito.when(connection.createStatement()).thenReturn(statement); final TableRegisterSupport support = new TableRegisterSupport(connection); Assert.assertTrue(support.dropTable("`feed`")); Mockito.verify(statement).execute("DROP TABLE IF EXISTS `feed`"); Assert.assertFalse(support.dropTable("`invalid`")); }
@Test(expected = NullPointerException.class) public void testDropTableWithNullConnection() { new TableRegisterSupport(null).dropTable("invalid"); }