protected function filterVatRateInfosByVatRates($vatRates, array $vatRateInfos = null)
    {
        $vatRates = (array) $vatRates;
        if ($vatRateInfos === null) {
            $vatRateInfos = $this->possibleVatRates;
        }

        $result = array();
        foreach ($vatRateInfos as $vatRateInfo) {
            $vatRate = $vatRateInfo[Tag::VatRate];
            foreach ($vatRates as $vatRateInfo2) {
                $vatRate2 = is_array($vatRateInfo2) ? $vatRateInfo2[Tag::VatRate] : $vatRateInfo2;
                if (Number::floatsAreEqual($vatRate, $vatRate2)) {
                    $result[] = $vatRateInfo;
                }
            }
        }
        return $result;
    }