### Question:
ElasticsearchStorageEngine extends CommonsStorageEngine<Client> { @Override @TimerJ protected void delete(TableName tableName, Collection<Filter> whereClauses, Connection<Client> connection) throws UnsupportedException, ExecutionException { String index = tableName.getCatalogName().getName(); QueryBuilderFactory queryBuilderFactory = new QueryBuilderFactory(); connection.getNativeConnection().prepareDeleteByQuery(index) .setQuery(queryBuilderFactory.createBuilder(whereClauses)).execute().actionGet(); } ElasticsearchStorageEngine(ConnectionHandler connectionHandler);   }### Answer:
@Test public void testDelete() throws Exception { Collection<Filter> whereFilter = new ArrayList<>(); Set operations = new HashSet<>(); operations.add(Operations.DELETE_PK_EQ); whereFilter.add(new Filter(operations, new Relation(new ColumnSelector(new ColumnName (INDEX_NAME, TYPE_NAME, COLUMN_NAME)), Operator.EQ, new StringSelector("1")))); QueryBuilderFactory queryBuilderFactory = mock(QueryBuilderFactory.class); QueryBuilder queryBuilder = mock(QueryBuilder.class); when(queryBuilderFactory.createBuilder(whereFilter)).thenReturn(queryBuilder); whenNew(QueryBuilderFactory.class).withNoArguments().thenReturn(queryBuilderFactory); ListenableActionFuture<DeleteByQueryResponse> listeneableActionFure = mock(ListenableActionFuture.class); DeleteByQueryRequestBuilder deleteByquery = mock(DeleteByQueryRequestBuilder.class); when(client.prepareDeleteByQuery(INDEX_NAME)).thenReturn(deleteByquery); when(deleteByquery.setQuery(queryBuilder)).thenReturn(deleteByquery); when(deleteByquery.execute()).thenReturn(listeneableActionFure); elasticsearchStorageEngine.delete(new TableName(INDEX_NAME, TYPE_NAME), whereFilter, connection); verify(listeneableActionFure).actionGet(); }