Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
FruitLover |
|
| 1.0;1 |
1 | /* | |
2 | * $Id: FruitLover.java 7976 2007-08-21 14:26:13Z dirk.olmes $ | |
3 | * -------------------------------------------------------------------------------------- | |
4 | * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com | |
5 | * | |
6 | * The software in this package is published under the terms of the CPAL v1.0 | |
7 | * license, a copy of which has been included with this distribution in the | |
8 | * LICENSE.txt file. | |
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 | 0 | private final List eatList = Collections.synchronizedList(new ArrayList()); |
20 | private final String catchphrase; | |
21 | ||
22 | public FruitLover(String catchphrase) | |
23 | 0 | { |
24 | 0 | this.catchphrase = catchphrase; |
25 | 0 | } |
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 | } |