@Override
  public OperationWithAttributes setAttribute(String name, byte[] value) {
    if (attributes == null && value == null) {
      return this;
    }

    if (attributes == null) {
      attributes = new HashMap<>();
    }

    if (value == null) {
      attributes.remove(name);
      if (attributes.isEmpty()) {
        this.attributes = null;
      }
    } else {
      attributes.put(name, value);
    }
    return this;
  }
empty construction. We need this empty construction to keep binary compatibility.
hbase-client/src/main/java/org/apache/hadoop/hbase/client/OperationWithAttributes.java