@Override
 public void postInvoke(IRubyObject rbValue, long[] arr, ToNativeContext context) {
   if (rbValue instanceof RubyArray && arr != null) {
     RubyArray rbArray = (RubyArray) rbValue;
     Ruby runtime = rbArray.getRuntime();
     for (int i = 0; i < arr.length; i++) {
       rbArray.store(i, Util.newSigned64(runtime, arr[i]));
     }
   }
 }
  @Override
  public long[] toNative(IRubyObject value, ToNativeContext context) {
    RubyArray rbArray = value.convertToArray();
    long[] arr = new long[rbArray.getLength()];

    if (ArrayFlags.isIn(arrayFlags)) {
      for (int i = 0; i < arr.length; i++) {
        arr[i] = Util.longValue(rbArray.entry(i));
      }
    }

    return arr;
  }