BigInteger (@NotNull Number value) { // don't forget to update fromBigInteger() after changing this method return value instanceof Integer ? BigInteger.valueOf((Integer)value) : value instanceof Long ? BigInteger.valueOf((Long)value) : (BigInteger)value; }