InMemoryDBDeleteTask implements IDatabaseTask { @Override public void prepare(final IObject query) throws TaskPrepareException { try { collectionName = (String) query.getValue(collectionNameFieldName); document = (IObject) query.getValue(documentFieldName); } catch (ReadValueException | InvalidArgumentException e) { throw new TaskPrepareException("Failed to getting values from query", e); } } InMemoryDBDeleteTask(); @Override void prepare(final IObject query); @Override void execute();  }
@Test public void testPrepare() throws InvalidArgumentException, TaskPrepareException, TaskExecutionException, ChangeValueException, IDatabaseException { InMemoryDBDeleteTask deleteTask = new InMemoryDBDeleteTask(); IObject query = new DSObject("{\"collectionName\": \"collection_name\"}"); IObject document = new DSObject("{\"hello\": \"world\"}"); IFieldName documentFieldName = new FieldName("document"); query.setValue(documentFieldName, document); deleteTask.prepare(query); }