code: public void setRegisters(Register[] registers) {
          if (registers == null) {
              this.registers = null;
              setDataLength(5);
          } else {
              this.registers = Arrays.copyOf(registers, registers.length);
              setDataLength(5 + registers.length * 2);
          }
      }
docs: setRegisters - Sets the registers to be written with this
  <tt>WriteMultipleRegistersRequest</tt>.
  <p>
  
  @param registers the registers to be written as <tt>Register[]</tt>.