@MJI
 public int substring__I__Ljava_lang_String_2(
     MJIEnv env, int objRef, int beginIndex, FeatureExpr ctx) {
   Integer aref = env.getReferenceField(ctx, objRef, "value").getValue();
   char[] buf = env.getCharArrayObject(aref).getValue();
   String obj = new String(buf);
   String result = obj.substring(beginIndex);
   return env.newString(ctx, result);
 }
  @SuppressWarnings("deprecation")
  @MJI
  public Conditional<Integer> indexOf__Ljava_lang_String_2I__I(
      final MJIEnv env, int objref, final int str, final int fromIndex, FeatureExpr ctx) {
    Integer aref = env.getReferenceField(ctx, objref, "value").getValue();
    Conditional<char[]> buf = env.getCharArrayObject(aref);
    return buf.mapf(
        ctx,
        new BiFunction<FeatureExpr, char[], Conditional<Integer>>() {

          @Override
          public Conditional<Integer> apply(FeatureExpr ctx, char[] buf) {
            String indexStr = env.getStringObject(ctx, str);
            return new One<>(new String(buf).indexOf(indexStr, fromIndex));
          }
        });
  }
  @MJI
  public int substring__II__Ljava_lang_String_2(
      MJIEnv env,
      int objRef,
      final Conditional<Integer> beginIndex,
      final Conditional<Integer> endIndex,
      FeatureExpr ctx) {
    Integer aref = env.getReferenceField(ctx, objRef, "value").getValue();
    Conditional<char[]> buf = env.getCharArrayObject(aref);
    Conditional<String> result =
        buf.mapf(
            ctx,
            new BiFunction<FeatureExpr, char[], Conditional<String>>() {

              @Override
              public Conditional<String> apply(FeatureExpr ctx, char[] buf) {
                String obj = new String(buf);
                return new One<>(obj.substring(beginIndex.getValue(), endIndex.getValue()));
              }
            });
    return env.newString(ctx, result);
  }