int (@NotNull Value value) { if (value instanceof IntegerValue) { return ((IntegerValue)value).value(); } throw new UnexpectedValueTypeException("value should be IntegerValue, but actual is " + value.type().name()); }