docs: public static String sprintf(Object self, String format, Object arg) {
          if (arg instanceof Object[]) {
              return sprintf(self, format, (Object[]) arg);
          }
          if (arg instanceof List) {
              return sprintf(self, format, ((List) arg).toArray());
          }
          if (!arg.getClass().isArray()) {
              Object[] o = (Object[]) java.lang.reflect.Array.newInstance(arg.getClass(), 1);
              o[0] = arg;
              return sprintf(self, format, o);
          }
  
          Object[] ans;
          String elemType = arg.getClass().getName();
          if (elemType.equals("[I")) {
              int[] ia = (int[]) arg;
              ans = new Integer[ia.length];
              for (int i = 0; i < ia.length; i++) {
                  ans[i] = ia[i];
              }
          } else if (elemType.equals("[C")) {
              char[] ca = (char[]) arg;
              ans = new Character[ca.length];
              for (int i = 0; i < ca.length; i++) {
                  ans[i] = ca[i];
              }
          } else if (elemType.equals("[Z")) {
              boolean[] ba = (boolean[]) arg;
              ans = new Boolean[ba.length];
              for (int i = 0; i < ba.length; i++) {
                  ans[i] = ba[i];
              }
          } else if (elemType.equals("[B")) {
              byte[] ba = (byte[]) arg;
              ans = new Byte[ba.length];
              for (int i = 0; i < ba.length; i++) {
                  ans[i] = ba[i];
              }
          } else if (elemType.equals("[S")) {
              short[] sa = (short[]) arg;
              ans = new Short[sa.length];
              for (int i = 0; i < sa.length; i++) {
                  ans[i] = sa[i];
              }
          } else if (elemType.equals("[F")) {
              float[] fa = (float[]) arg;
              ans = new Float[fa.length];
              for (int i = 0; i < fa.length; i++) {
                  ans[i] = fa[i];
              }
          } else if (elemType.equals("[J")) {
              long[] la = (long[]) arg;
              ans = new Long[la.length];
              for (int i = 0; i < la.length; i++) {
                  ans[i] = la[i];
              }
          } else if (elemType.equals("[D")) {
              double[] da = (double[]) arg;
              ans = new Double[da.length];
              for (int i = 0; i < da.length; i++) {
                  ans[i] = da[i];
              }
          } else {
              throw new RuntimeException("sprintf(String," + arg + ")");
          }
          return sprintf(self, format, ans);
      }