private static @Nullable Attribute createBootstrapMethods(ClassReader classReader, ClassWriter classWriter) {
    Set<Short> bootstrapMethods = new HashSet<>();
    // scan class pool for indy calls
    for (int i = 1; i < classReader.getItemCount(); i++) {
      int index = classReader.getItem(i);
      int tag = classReader.readByte(index - 1);
      switch (tag) {
        case 5, 6 ->  // Symbol.CONSTANT_LONG_TAG, Symbol.CONSTANT_DOUBLE_TAG
          //noinspection AssignmentToForLoopParameter
          ++i;
        case 17, 18 ->  // Symbol.CONSTANT_DYNAMIC_TAG, Symbol.CONSTANT_INVOKE_DYNAMIC_TAG
          bootstrapMethods.add(classReader.readShort(index));
      }
    }

    if (!bootstrapMethods.isEmpty()) {
      int dummyRef = classWriter.newHandle(Opcodes.H_INVOKESTATIC, "DummyOwner", "DummyMethod", "", false); // dummy for now
      return createAttribute("BootstrapMethods", dos -> {
        dos.writeShort(bootstrapMethods.size());
        for (int i = 0; i < bootstrapMethods.size(); i++) {
          dos.writeShort(dummyRef); // bootstrap_method_ref
          dos.writeShort(0); // num_bootstrap_arguments
        }
      });
    }

    return null;
  }
private static @Nullable Attribute createBootstrapMethods(ClassReader classReader, ClassWriter classWriter)