ThreeState (@NotNull Iterable<? extends ThreeState> states) { ThreeState result = NO; for (ThreeState state : states) { switch (state) { case YES: return YES; case UNSURE: result = UNSURE; } } return result; }