View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.tck.testmodels.fruit;
8   
9   import java.util.ArrayList;
10  import java.util.Collections;
11  import java.util.List;
12  
13  public class FruitLover
14  {
15      private final List eatList = Collections.synchronizedList(new ArrayList());
16      private final String catchphrase;
17  
18      public FruitLover(String catchphrase)
19      {
20          this.catchphrase = catchphrase;
21      }
22  
23      public void eatFruit(Fruit fruit)
24      {
25          fruit.bite();
26          eatList.add(fruit.getClass());
27      }
28  
29      public List getEatList()
30      {
31          return eatList;
32      }
33  
34      public String speak()
35      {
36          return catchphrase;
37      }
38  }