public Set<RowKey> getKeys() { Set<RowKey> keys = new HashSet<RowKey>(); if (!cleared) { keys.addAll(snapshot.getRowKeys()); } for (Map.Entry<RowKey, AssociationOperation> op : currentState.entrySet()) { switch (op.getValue().getType()) { case PUT: case PUT_NULL: keys.add(op.getKey()); break; case REMOVE: keys.remove(op.getKey()); break; } } return keys; }