|
|
|
|
Source |
1 | package com.instantiations.example.miscellaneous; |
2 | |
3 | import java.util.*; |
4 | |
5 | /** |
6 | * The class <code>MappingCode</code> demonstrates how the test case generator |
7 | * can use static analysis to create good values of even complex objects such |
8 | * as a {@link Map}. |
9 | * @author Brad Billings |
10 | */ |
11 | public class MappingCode |
12 | { |
13 | public int testStrings(Map map) |
14 | { |
15 | if (map == null) { |
16 | return 0; |
17 | } |
18 | if ("value".equals(map.get("key"))) { |
19 | return 1; |
20 | } |
21 | return 2; |
22 | } |
23 | } |