class MqttMessageIdVariableHeader {

    private final int messageId;

    public static MqttMessageIdVariableHeader from(int messageId) {<FILL_FUNCTION_BODY>}

    protected MqttMessageIdVariableHeader(int messageId) {
        this.messageId = messageId;
    }

    public int messageId() {
        return messageId;
    }

    @Override
    public String toString() {
        return new StringBuilder(StringUtil.simpleClassName(this))
            .append('[')
            .append("messageId=").append(messageId)
            .append(']')
            .toString();
    }

    public MqttMessageIdAndPropertiesVariableHeader withEmptyProperties() {
        return new MqttMessageIdAndPropertiesVariableHeader(messageId, MqttProperties.NO_PROPERTIES);
    }

    MqttMessageIdAndPropertiesVariableHeader withDefaultEmptyProperties() {
        return withEmptyProperties();
    }
}

      if (messageId < 1 || messageId > 0xffff) {
        throw new IllegalArgumentException("messageId: " + messageId + " (expected: 1 ~ 65535)");
      }
      return new MqttMessageIdVariableHeader(messageId);
    
<no_super_class>