int (@NotNull ArrayReference value) { final Value timeArray = value.getValue(1); if (timeArray instanceof ArrayReference) { final Value time = ((ArrayReference)timeArray).getValue(0); if (time instanceof IntegerValue) { return ((IntegerValue)time).value(); } } throw new UnexpectedValueException("Could not find a maximum time value"); }