protected function createTaxRateAmountFromDefinition(array $definition)
    {
        $amount = new TaxRateAmount();
        $setValues = \Closure::bind(function ($definition) {
            $this->id = $definition['id'];
            $this->amount = $definition['amount'];
            if (isset($definition['start_date'])) {
                $this->startDate = new \DateTime($definition['start_date']);
            }
            if (isset($definition['end_date'])) {
                $this->endDate = new \DateTime($definition['end_date']);
            }
        }, $amount, '\CommerceGuys\Tax\Model\TaxRateAmount');
        $setValues($definition);

        return $amount;
    }