You must decide the promise yourself. Remember that Play promises are shells for scala futures and that the only way to decide the future is to use scala promises (different from play promises) (I know this is a bit confusing). You will need to do something like this:
Promise<Long> promise = Promise$.MODULE$.apply(); collection.count( new SingleResultCallback<Long>() { @Override public void onResult(final Long count, final Throwable t) { promise.success(count); } }); return F.Promise.wrap(promise.future());
This thing about Promise$.MODULE$.apply() is just a way to access scala objects from java.
source share