public boolean validate() throws Exception
    {
        boolean result = true;

        if (this.products.size() == 0)
            throw new Exception("Не указаны товары");

        if (this.payed.size() == 0)
            throw new Exception("Не указаны платежи");

        for(int i = 0; i < this.taxes.length; i++)
            if(this.taxes[i] < 0 || this.taxes[i] > 4)
                throw new Exception("Неверные параметры налогов");

        double total_to_pay = 0.0;
        for(Product p : this.products )
            total_to_pay += (p.count * p.price);

        double total_payed = 0.0;
        for(Double payment : this.payed)
            total_payed += payment;

        if (Math.round(total_payed) < Math.round(total_to_pay))
            throw new Exception("Недостаточная оплата ( нужно " + Double.toString(total_to_pay) + ", заплачено "  + Double.toString(total_payed) + " )");

        return result;
    }