Transaction tx = DatastoreServiceFactory.getDatastoreService().beginTransaction();
final int beforeNumTasks = getDefaultQueue().fetchStatistics().getNumTasks();
try {
getDefaultQueue().add(tx, Collections.singleton(TaskOptions.Builder.withDefaults()));
} finally {
tx.rollback();
}
sync(10000); // Wait for statistics servers to refresh.
Assert.assertEquals(beforeNumTasks, getDefaultQueue().fetchStatistics().getNumTasks());
}