package pages;

import java.io.Serializable;

import javax.enterprise.context.SessionScoped;
import javax.inject.Named;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

@Named
@Sessionscoped
public class Basket extends Page implements Serializable{

    static List<Product> products = new ArrayList<Product>();

    /**
     *
     * @return List<Products>
     */
    public List<Products> getBasket(){
        return products;
    }

    /**
     *
     ** @param  Product updated
     */

    public void edit(Product old, Product updated){
        int place = products.indexOf(old);
        //products.addAt(place, updated);
        products.remove(place);
        product.add(updated);
    }

    /**
     * @param selected
     *
     */

    public void remove(Product selected){
        int place = products.indexOf(old);
        products.remove(place);
    }

    /**
     *
     * @param Product item
     */

    public void add(Product item){
        product.add(item);
    }
}

@@ -117,38 +117,63 @@
 ed;%0A
+%0A
 import 
-java.sql.SQLException
+baseClasses.Page;%0Aimport baseClasses.Product
 ;%0A
+%0A
 impo
@@ -235,17 +235,17 @@
 @Session
-s
+S
 coped%0Apu
@@ -440,17 +440,16 @@
 %3CProduct
-s
 %3E getBas
@@ -723,24 +723,25 @@
      product
+s
 .add(updated
@@ -836,16 +836,29 @@
 selected
+, Product old
 )%7B%0A     
@@ -1020,16 +1020,16 @@
  item)%7B%0A
-
         
@@ -1035,16 +1035,17 @@
  product
+s
 .add(ite

Update Basket.java