protected OperationMap assertCollectedEnvironment(Operation op, Map<?, ?> env) {
OperationMap envMap = op.get("environment", OperationMap.class);
assertNotNull("Missing environment in " + op.getLabel(), envMap);
assertEquals("Mismatched environment size in " + op.getLabel(), MapUtil.size(env), envMap.size());
Collection<? extends Map.Entry<String, ?>> envEntries = envMap.entrySet();
Collection<Object> expKeys = new HashSet<Object>(env.keySet());
for (Map.Entry<String, ?> ee : envEntries) {
String key = ee.getKey();
Object expected = env.get(key), actual = ee.getValue();
assertEquals(op.getLabel() + ": Mismatched values for key=" + key, expected, actual);