TypeDfaState (@NotNull List<? extends TypeDfaState> ins) { if (ins.size() == 0) { return TypeDfaState.EMPTY_STATE; } if (ins.size() == 1) { return ins.get(0); } TypeDfaState result = ins.get(0); for (int i = 1; i < ins.size(); i++) { if (ins.get(i) != TypeDfaState.EMPTY_STATE) { result = TypeDfaState.merge(result, ins.get(i), myManager); } else { return TypeDfaState.EMPTY_STATE; } } return result; }