InMemoryDBCreateCollectionTask implements IDatabaseTask { @Override public void prepare(final IObject query) throws TaskPrepareException { try { this.collectionName = (String) query.getValue(collectionNameField); } catch (ReadValueException | InvalidArgumentException e) { throw new TaskPrepareException("Failed to resolve get \"collectionName\" from query", e); } } InMemoryDBCreateCollectionTask(); @Override void prepare(final IObject query); @Override void execute();  }
@Test public void testPreparing() throws InvalidArgumentException, TaskPrepareException { InMemoryDBCreateCollectionTask createCollectionTask = new InMemoryDBCreateCollectionTask(); IObject query = new DSObject("{\"collectionName\": \"collection_name\"}"); createCollectionTask.prepare(query); }