1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
package org.mule.tck.testmodels.fruit; |
12 | |
|
13 | |
import java.util.ArrayList; |
14 | |
import java.util.Collections; |
15 | |
import java.util.List; |
16 | |
|
17 | |
public class FruitLover |
18 | |
{ |
19 | 6 | private final List eatList = Collections.synchronizedList(new ArrayList()); |
20 | |
private final String catchphrase; |
21 | |
|
22 | |
public FruitLover(String catchphrase) |
23 | 6 | { |
24 | 6 | this.catchphrase = catchphrase; |
25 | 6 | } |
26 | |
|
27 | |
public void eatFruit(Fruit fruit) |
28 | |
{ |
29 | 0 | fruit.bite(); |
30 | 0 | eatList.add(fruit.getClass()); |
31 | 0 | } |
32 | |
|
33 | |
public List getEatList() |
34 | |
{ |
35 | 0 | return eatList; |
36 | |
} |
37 | |
|
38 | |
public String speak() |
39 | |
{ |
40 | 0 | return catchphrase; |
41 | |
} |
42 | |
} |