I disagree with this implementation. It should return a Flag object. In particular, it could act weird if `flag` is a grouped enum value.