Map<Class<?>, Agreement> approvals = new HashMap<>();
for (Map.Entry<Class<?>, StoreCallback> entry : callbacks.entrySet()) {
Class<?> store = entry.getKey();
StoreCallback callback = entry.getValue();
Agreement agreement = callback.voteFor(action);
if (agreement.isApproved()) {
approvals.put(store, agreement);
}
}
return approvals;