Przeglądaj źródła

Change code according to FridaTveit's review

Zaldrick 9 lat temu
rodzic
commit
46dabc3ffe

+ 346
- 0
config.json~ Wyświetl plik

@@ -0,0 +1,346 @@
1
+{
2
+  "slug": "java",
3
+  "language": "Java",
4
+  "repository": "https://github.com/exercism/xjava",
5
+  "active": true,
6
+  "exercises": [
7
+    {
8
+      "slug": "hello-world",
9
+      "difficulty": 1,
10
+      "topics": []
11
+    },
12
+    {
13
+      "slug": "rna-transcription",
14
+      "difficulty": 2,
15
+      "topics": []
16
+    },
17
+    {
18
+      "slug": "pangram",
19
+      "difficulty": 3,
20
+      "topics": []
21
+    },
22
+    {
23
+      "slug": "hamming",
24
+      "difficulty": 3,
25
+      "topics": []
26
+    },
27
+    {
28
+      "slug": "gigasecond",
29
+      "difficulty": 3,
30
+      "topics": []
31
+    },
32
+    {
33
+      "slug": "space-age",
34
+      "difficulty": 3,
35
+      "topics": []
36
+    },
37
+    {
38
+      "slug": "acronym",
39
+      "difficulty": 3,
40
+      "topics": []
41
+    },
42
+    {
43
+      "slug": "scrabble-score",
44
+      "difficulty": 3,
45
+      "topics": []
46
+    },
47
+    {
48
+      "slug": "raindrops",
49
+      "difficulty": 3,
50
+      "topics": []
51
+    },
52
+    {
53
+      "slug": "difference-of-squares",
54
+      "difficulty": 3,
55
+      "topics": []
56
+    },
57
+    {
58
+      "slug": "secret-handshake",
59
+      "difficulty": 3,
60
+      "topics": []
61
+    },
62
+    {
63
+      "slug": "sum-of-multiples",
64
+      "difficulty": 4,
65
+      "topics": []
66
+    },
67
+    {
68
+      "slug": "luhn",
69
+      "difficulty": 4,
70
+      "topics": []
71
+    },
72
+    {
73
+      "slug": "matrix",
74
+      "difficulty": 4,
75
+      "topics": []
76
+    },
77
+    {
78
+      "slug": "triangle",
79
+      "difficulty": 4,
80
+      "topics": []
81
+    },
82
+    {
83
+      "slug": "largest-series-product",
84
+      "difficulty": 4,
85
+      "topics": []
86
+    },
87
+    {
88
+      "slug": "sieve",
89
+      "difficulty": 4,
90
+      "topics": []
91
+    },
92
+    {
93
+      "slug": "twelve-days",
94
+      "difficulty": 4,
95
+      "topics": []
96
+    },
97
+    {
98
+      "slug": "nth-prime",
99
+      "difficulty": 4,
100
+      "topics": []
101
+    },
102
+    {
103
+      "slug": "diamond",
104
+      "difficulty": 4,
105
+      "topics": []
106
+    },
107
+    {
108
+      "slug": "flatten-array",
109
+      "difficulty": 5,
110
+      "topics": []
111
+    },
112
+    {
113
+      "slug": "pig-latin",
114
+      "difficulty": 5,
115
+      "topics": []
116
+    },
117
+    {
118
+      "slug": "phone-number",
119
+      "difficulty": 5,
120
+      "topics": []
121
+    },
122
+    {
123
+      "slug": "accumulate",
124
+      "difficulty": 5,
125
+      "topics": []
126
+    },
127
+    {
128
+      "slug": "nucleotide-count",
129
+      "difficulty": 5,
130
+      "topics": []
131
+    },
132
+    {
133
+      "slug": "word-count",
134
+      "difficulty": 5,
135
+      "topics": []
136
+    },
137
+    {
138
+      "slug": "robot-name",
139
+      "difficulty": 5,
140
+      "topics": []
141
+    },
142
+    {
143
+      "slug": "prime-factors",
144
+      "difficulty": 5,
145
+      "topics": []
146
+    },
147
+    {
148
+      "slug": "allergies",
149
+      "difficulty": 5,
150
+      "topics": []
151
+    },
152
+    {
153
+      "slug": "bob",
154
+      "difficulty": 5,
155
+      "topics": []
156
+    },
157
+    {
158
+      "slug": "pascals-triangle",
159
+      "difficulty": 5,
160
+      "topics": []
161
+    },
162
+    {
163
+      "slug": "bracket-push",
164
+      "difficulty": 5,
165
+      "topics": []
166
+    },
167
+    {
168
+      "slug": "series",
169
+      "difficulty": 5,
170
+      "topics": []
171
+    },
172
+    {
173
+      "slug": "atbash-cipher",
174
+      "difficulty": 5,
175
+      "topics": []
176
+    },
177
+    {
178
+      "slug": "strain",
179
+      "difficulty": 5,
180
+      "topics": []
181
+    },
182
+    {
183
+      "slug": "roman-numerals",
184
+      "difficulty": 6,
185
+      "topics": []
186
+    },
187
+    {
188
+      "slug": "beer-song",
189
+      "difficulty": 6,
190
+      "topics": []
191
+    },
192
+    {
193
+      "slug": "queen-attack",
194
+      "difficulty": 6,
195
+      "topics": []
196
+    },
197
+    {
198
+      "slug": "etl",
199
+      "difficulty": 6,
200
+      "topics": []
201
+    },
202
+    {
203
+      "slug": "linked-list",
204
+      "difficulty": 6,
205
+      "topics": []
206
+    },
207
+    {
208
+      "slug": "grade-school",
209
+      "difficulty": 6,
210
+      "topics": []
211
+    },
212
+    {
213
+      "slug": "robot-simulator",
214
+      "difficulty": 6,
215
+      "topics": []
216
+    },
217
+    {
218
+      "slug": "binary-search",
219
+      "difficulty": 6,
220
+      "topics": []
221
+    },
222
+    {
223
+      "slug": "minesweeper",
224
+      "difficulty": 6,
225
+      "topics": []
226
+    },
227
+    {
228
+      "slug": "wordy",
229
+      "difficulty": 6,
230
+      "topics": []
231
+    },
232
+    {
233
+      "slug": "all-your-base",
234
+      "difficulty": 6,
235
+      "topics": []
236
+    },
237
+    {
238
+      "slug": "anagram",
239
+      "difficulty": 7,
240
+      "topics": []
241
+    },
242
+    {
243
+      "slug": "sublist",
244
+      "difficulty": 7,
245
+      "topics": []
246
+    },
247
+    {
248
+      "slug": "simple-linked-list",
249
+      "difficulty": 7,
250
+      "topics": []
251
+    },
252
+    {
253
+      "slug": "binary-search-tree",
254
+      "difficulty": 7,
255
+      "topics": []
256
+    },
257
+    {
258
+      "slug": "rectangles",
259
+      "difficulty": 7,
260
+      "topics": []
261
+    },
262
+    {
263
+      "slug": "meetup",
264
+      "difficulty": 7,
265
+      "topics": []
266
+    },
267
+    {
268
+      "slug": "crypto-square",
269
+      "difficulty": 7,
270
+      "topics": []
271
+    },
272
+    {
273
+      "slug": "poker",
274
+      "difficulty": 7,
275
+      "topics": [
276
+        "Parsing",
277
+        "Sorting",
278
+        "Games"
279
+      ]
280
+    },
281
+    {
282
+      "slug": "simple-cipher",
283
+      "difficulty": 8,
284
+      "topics": []
285
+    },
286
+    {
287
+      "slug": "palindrome-products",
288
+      "difficulty": 8,
289
+      "topics": []
290
+    },
291
+    {
292
+      "slug": "pythagorean-triplet",
293
+      "difficulty": 9,
294
+      "topics": []
295
+    },
296
+    {
297
+      "slug": "custom-set",
298
+      "difficulty": 10,
299
+      "topics": []
300
+    },
301
+    {
302
+      "slug": "clock",
303
+      "difficulty": 1,
304
+      "topics": []
305
+    },
306
+    {
307
+      "slug": "perfect-numbers",
308
+      "difficulty": 1,
309
+      "topics": []
310
+    },
311
+    {
312
+      "slug": "change",
313
+      "difficulty": 1,
314
+      "topics": []
315
+    },
316
+    {
317
+      "slug": "list-ops",
318
+      "difficulty": 1,
319
+      "topics": []
320
+    },
321
+    {
322
+      "slug": "ocr-numbers",
323
+      "difficulty": 1,
324
+      "topics": []
325
+    }
326
+  ],
327
+  "deprecated": [
328
+    "binary",
329
+    "hexadecimal",
330
+    "octal",
331
+    "trinary"
332
+  ],
333
+  "ignored": [
334
+    "_template",
335
+    ".gradle",
336
+    "build",
337
+    "docs",
338
+    "gradle",
339
+    "scripts"
340
+  ],
341
+  "foregone": [
342
+    "leap",
343
+    "grains",
344
+    "say"
345
+  ]
346
+}

+ 105
- 100
exercises/poker/src/example/java/Poker.java Wyświetl plik

@@ -12,126 +12,131 @@ import java.util.stream.Collectors;
12 12
 public class Poker {
13 13
 	private static class Card {
14 14
 		private int rank;
15
-		private int Suit;
15
+		private int suit;
16 16
 
17 17
 		public Card(String card) {
18
-			rank = Parserank(card);
19
-			Suit = ParseSuit(card);
18
+			rank = parseRank(card);
19
+			suit = parseSuit(card);
20 20
 		}
21 21
 
22
-		public int getRank() {
22
+		private int getRank() {
23 23
 			return rank;
24 24
 		}
25
-	}
26
-
27
-	private static class Hand {
28
-		private String input;
29
-		private int score;
30
-
31
-		public Hand(String hand) {
32
-			this.input = hand;
33
-			this.score = ScoreHand(ParseCards(hand));
34
-		}
35
-		
36
-		public int getScore() {
37
-			return score;
38
-		}
39 25
 
40
-		public String getInput() {
41
-			return input;
26
+		private int getSuit() {
27
+			return suit;
42 28
 		}
43
-	}
44 29
 
45
-	public static List<String> BestHands(List<String> hands) {
46
-		ArrayList<Hand> scoredHands = new ArrayList<Hand>();
47
-
48
-		for (String s : hands) {
49
-			scoredHands.add(new Hand(s));
30
+		private static int parseRank(String card) {
31
+			return "..23456789TJQKA".indexOf(card.charAt(0));
50 32
 		}
51 33
 
52
-		int maxscore = scoredHands.stream().map(h -> h.getScore()).max(Comparator.naturalOrder()).get();
53
-		return scoredHands.stream().filter(h -> h.getScore() == maxscore).map(h -> h.getInput())
54
-				.collect(Collectors.toList());
55
-	}
56
-
57
-	public static List<Card> ParseCards(String hand) {
58
-		ArrayList<Card> parseCards = new ArrayList<Card>();
59
-		String[] parseString = hand.split(" ");
60
-		for (int i = 0; i < parseString.length; i++) {
61
-			parseCards.add(new Poker.Card(parseString[i]));
34
+		private static int parseSuit(String card) {
35
+			return ".HSDC".indexOf(card.charAt(1));
62 36
 		}
63
-		return parseCards;
64
-	}
65
-
66
-	public static int Parserank(String card) {
67
-		return "..23456789TJQKA".indexOf(card.charAt(0));
68
-	}
69
-
70
-	public static int ParseSuit(String card) {
71
-		return ".HSDC".indexOf(card.charAt(1));
72 37
 	}
73 38
 
74
-	private static int ScoreHand(List<Card> cards) {
75
-
76
-		List<Card> cardsByrank = new ArrayList<Card>();
39
+		private static class Hand {
40
+			private String input;
41
+			private int score;
77 42
 
78
-		cardsByrank = cards.stream().sorted(Comparator.comparing(Card::getRank)).unordered()
79
-				.collect(Collectors.toList());
80
-
81
-		Map<Integer, Integer> frequencymap = new HashMap<Integer, Integer>();
82
-		for (Card c : cards) {
83
-			if (frequencymap.containsKey(c.rank)) {
84
-				frequencymap.put(c.getRank(), frequencymap.get(c.getRank()) + 1);
85
-			} else {
86
-				frequencymap.put(c.getRank(), 1);
43
+			private Hand(String hand) {
44
+				this.input = hand;
45
+				this.score = scoreHand(parseCards(hand));
87 46
 			}
88
-		}
89 47
 
90
-		List<Integer> ranks = frequencymap.entrySet().stream().map(x -> x.getKey()).sorted(Comparator.reverseOrder())
91
-				.collect(Collectors.toList());
92
-
93
-		frequencymap = frequencymap.entrySet().stream().sorted(Map.Entry.comparingByValue(Collections.reverseOrder()))
94
-				.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e1, LinkedHashMap::new));
48
+			private int getScore() {
49
+				return score;
50
+			}
95 51
 
96
-		List<Integer> rankCounts = frequencymap.entrySet().stream().map(x -> x.getValue()).collect(Collectors.toList());
52
+			private String getInput() {
53
+				return input;
54
+			}
97 55
 
98
-		List<Integer> suits = cards.stream().map(s -> s.Suit).collect(Collectors.toList());
56
+			private static List<Card> parseCards(String hand) {
57
+				ArrayList<Card> parseCards = new ArrayList<Card>();
58
+				String[] parseString = hand.split(" ");
59
+				for (int i = 0; i < parseString.length; i++) {
60
+					parseCards.add(new Poker.Card(parseString[i]));
61
+				}
62
+				return parseCards;
63
+			}
99 64
 
100
-		if (ranks.equals(Arrays.asList(14, 5, 4, 3, 2))) {
101
-			ranks = Arrays.asList(5, 4, 3, 2, 1);
65
+			private static int scoreHand(List<Card> cards) {
66
+
67
+				List<Card> cardsByrank = new ArrayList<Card>();
68
+
69
+				cardsByrank = cards.stream().sorted(Comparator.comparing(Card::getRank)).unordered()
70
+						.collect(Collectors.toList());
71
+
72
+				Map<Integer, Integer> frequencymap = new HashMap<Integer, Integer>();
73
+				for (Card c : cards) {
74
+					if (frequencymap.containsKey(c.rank)) {
75
+						frequencymap.put(c.getRank(), frequencymap.get(c.getRank()) + 1);
76
+					} else {
77
+						frequencymap.put(c.getRank(), 1);
78
+					}
79
+				}
80
+
81
+				List<Integer> ranks = frequencymap.entrySet().stream().map(x -> x.getKey())
82
+						.sorted(Comparator.reverseOrder()).collect(Collectors.toList());
83
+
84
+				frequencymap = frequencymap.entrySet().stream()
85
+						.sorted(Map.Entry.comparingByValue(Collections.reverseOrder())).collect(Collectors
86
+								.toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e1, LinkedHashMap::new));
87
+
88
+				List<Integer> rankCounts = frequencymap.entrySet().stream().map(x -> x.getValue())
89
+						.collect(Collectors.toList());
90
+
91
+				List<Integer> suits = cards.stream().map(s -> s.getSuit()).collect(Collectors.toList());
92
+
93
+				if (ranks.equals(Arrays.asList(14, 5, 4, 3, 2))) {
94
+					ranks = Arrays.asList(5, 4, 3, 2, 1);
95
+				}
96
+
97
+				boolean flush = suits.stream().distinct().count() == 1;
98
+				boolean straight = ranks.stream().distinct().count() == 5 && ranks.get(0) - ranks.get(4) == 4;
99
+				Iterator<Integer> itr = frequencymap.keySet().iterator();
100
+				int pairA = itr.next();
101
+
102
+				if (straight && flush) {
103
+					return 800 + frequencymap.keySet().iterator().next();
104
+				}
105
+				if (rankCounts.equals(Arrays.asList(4, 1))) {
106
+					return (700 + (cardsByrank.get(0)).getRank());
107
+				}
108
+				if (rankCounts.equals(Arrays.asList(3, 2))) {
109
+					return 600 + cardsByrank.get(0).getRank();
110
+				}
111
+				if (flush) {
112
+					return 500 + frequencymap.keySet().iterator().next();
113
+				}
114
+				if (straight) {
115
+					return 400 + frequencymap.keySet().iterator().next();
116
+				}
117
+				if (rankCounts.equals(Arrays.asList(3, 1, 1))) {
118
+					return 300 + cardsByrank.get(0).getRank();
119
+				}
120
+				if (rankCounts.equals(Arrays.asList(2, 2, 1))) {
121
+					return 200 + Math.max(pairA, itr.next());
122
+				}
123
+				if (rankCounts.equals(Arrays.asList(2, 1, 1, 1))) {
124
+					return 100 + pairA;
125
+				}
126
+				Collections.sort(ranks, (a, b) -> b.compareTo(a));
127
+				Collections.reverse(ranks);
128
+				return ranks.get(0);
129
+			}
102 130
 		}
131
+			public static List<String> bestHands(List<String> hands) {
132
+				ArrayList<Hand> scoredHands = new ArrayList<Hand>();
103 133
 
104
-		boolean flush = suits.stream().distinct().count() == 1;
105
-		boolean straight = ranks.stream().distinct().count() == 5 && ranks.get(0) - ranks.get(4) == 4;
106
-		Iterator<Integer> itr = frequencymap.keySet().iterator();
107
-		int pairA = itr.next();
134
+				for (String s : hands) {
135
+					scoredHands.add(new Hand(s));
136
+				}
108 137
 
109
-		if (straight && flush) {
110
-			return 800 + frequencymap.keySet().iterator().next();
111
-		}
112
-		if (rankCounts.equals(Arrays.asList(4, 1))) {
113
-			return (700 + (cardsByrank.get(0)).getRank());
114
-		}
115
-		if (rankCounts.equals(Arrays.asList(3, 2))) {
116
-			return 600 + cardsByrank.get(0).getRank();
117
-		}
118
-		if (flush) {
119
-			return 500 + frequencymap.keySet().iterator().next();
120
-		}
121
-		if (straight) {
122
-			return 400 + frequencymap.keySet().iterator().next();
123
-		}
124
-		if (rankCounts.equals(Arrays.asList(3, 1, 1))) {
125
-			return 300 + cardsByrank.get(0).getRank();
126
-		}
127
-		if (rankCounts.equals(Arrays.asList(2, 2, 1))) {
128
-			return 200 + Math.max(pairA, itr.next());
129
-		}
130
-		if (rankCounts.equals(Arrays.asList(2, 1, 1, 1))) {
131
-			return 100 + pairA;
132
-		}
133
-		Collections.sort(ranks, (a, b) -> b.compareTo(a));
134
-		Collections.reverse(ranks);
135
-		return ranks.get(0);
136
-	}
137
-}
138
+				int maxscore = scoredHands.stream().map(h -> h.getScore()).max(Comparator.naturalOrder()).get();
139
+				return scoredHands.stream().filter(h -> h.getScore() == maxscore).map(h -> h.getInput())
140
+						.collect(Collectors.toList());
141
+			}
142
+}

+ 2
- 2
exercises/poker/src/main/java/Poker.java Wyświetl plik

@@ -4,9 +4,9 @@ import sun.reflect.generics.reflectiveObjects.NotImplementedException;
4 4
 
5 5
 public class Poker {
6 6
 
7
-	public static List<String> BestHands(List<String> hands) {
7
+	public static List<String> bestHands(List<String> hands) {
8 8
 		{
9 9
 			throw new NotImplementedException();
10 10
 		}
11 11
 	}
12
-}
12
+}

+ 40
- 40
exercises/poker/src/test/java/PokerTest.java Wyświetl plik

@@ -1,4 +1,4 @@
1
-import static org.junit.Assert.*;
1
+import static org.junit.Assert.assertEquals;
2 2
 import java.util.Arrays;
3 3
 import org.junit.Ignore;
4 4
 import org.junit.Test;
@@ -6,176 +6,176 @@ import org.junit.Test;
6 6
 public class PokerTest
7 7
 {
8 8
     @Test
9
-    public void One_hand()
9
+    public void OneHand()
10 10
     {
11 11
         final String hand = "4S 5S 7H 8D JC";
12
-        assertEquals(Arrays.asList(hand),Poker.BestHands(Arrays.asList(hand)));
12
+        assertEquals(Arrays.asList(hand),Poker.bestHands(Arrays.asList(hand)));
13 13
     }
14 14
 
15 15
     @Test
16 16
     @Ignore
17
-    public void Nothing_vs_one_pair()
17
+    public void NothingVsOnePair()
18 18
     {
19 19
         final String nothing = "4S 5H 6S 8D JH";
20 20
         final String pairOf4 = "2S 4H 6S 4D JH";
21
-        assertEquals(Arrays.asList(pairOf4), Poker.BestHands(Arrays.asList(nothing, pairOf4)));
21
+        assertEquals(Arrays.asList(pairOf4), Poker.bestHands(Arrays.asList(nothing, pairOf4)));
22 22
     }
23 23
 
24 24
     @Test
25 25
     @Ignore
26
-    public void Two_pairs()
26
+    public void TwoPairs()
27 27
     {
28 28
         final String pairOf2 = "4S 2H 6S 2D JH";
29 29
         final String pairOf4 = "2S 4H 6S 4D JH";
30
-        assertEquals(Arrays.asList(pairOf4), Poker.BestHands(Arrays.asList(pairOf2,pairOf4)));
30
+        assertEquals(Arrays.asList(pairOf4), Poker.bestHands(Arrays.asList(pairOf2,pairOf4)));
31 31
     }
32 32
 
33 33
     @Test
34 34
     @Ignore
35
-    public void One_pair_vs_double_pair()
35
+    public void OnePairVsDoublePair()
36 36
     {
37 37
         final String pairOf8 = "2S 8H 6S 8D JH";
38 38
         final String doublePair = "4S 5H 4S 8D 5H";
39
-        assertEquals(Arrays.asList(doublePair), Poker.BestHands(Arrays.asList(pairOf8, doublePair)));
39
+        assertEquals(Arrays.asList(doublePair), Poker.bestHands(Arrays.asList(pairOf8, doublePair)));
40 40
     }
41 41
 
42 42
     @Test
43 43
     @Ignore
44
-    public void Two_double_pairs()
44
+    public void TwoDoublePairs()
45 45
     {
46 46
         final String doublePair2And8 = "2S 8H 2S 8D JH";
47 47
         final String doublePair4And5 = "4S 5H 4S 8D 5H";
48
-        assertEquals(Arrays.asList(doublePair2And8), Poker.BestHands(Arrays.asList(doublePair2And8, doublePair4And5)));
48
+        assertEquals(Arrays.asList(doublePair2And8), Poker.bestHands(Arrays.asList(doublePair2And8, doublePair4And5)));
49 49
     }
50 50
 
51 51
     @Test
52 52
     @Ignore
53
-    public void Double_pair_vs_three()
53
+    public void DoublePairVsThree()
54 54
     {
55 55
         final String doublePair2And8 = "2S 8H 2S 8D JH";
56 56
         final String threeOf4 = "4S 5H 4S 8D 4H";
57
-        assertEquals(Arrays.asList(threeOf4 ), Poker.BestHands(Arrays.asList(doublePair2And8, threeOf4 )));
57
+        assertEquals(Arrays.asList(threeOf4 ), Poker.bestHands(Arrays.asList(doublePair2And8, threeOf4 )));
58 58
     }
59 59
 
60 60
     @Test
61 61
     @Ignore
62
-    public void Two_threes()
62
+    public void TwoThrees()
63 63
     {
64 64
         final String threeOf2 = "2S 2H 2S 8D JH";
65 65
         final String threeOf1 = "4S AH AS 8D AH";
66
-        assertEquals(Arrays.asList(threeOf1), Poker.BestHands(Arrays.asList(threeOf2, threeOf1)));
66
+        assertEquals(Arrays.asList(threeOf1), Poker.bestHands(Arrays.asList(threeOf2, threeOf1)));
67 67
     }
68 68
 
69 69
     @Test
70 70
     @Ignore
71
-    public void Three_vs_straight()
71
+    public void ThreeVsStraight()
72 72
     {
73 73
         final String threeOf4 = "4S 5H 4S 8D 4H";
74 74
         final String straight = "3S 4H 2S 6D 5H";
75
-        assertEquals(Arrays.asList(straight), Poker.BestHands(Arrays.asList(threeOf4, straight )));
75
+        assertEquals(Arrays.asList(straight), Poker.bestHands(Arrays.asList(threeOf4, straight )));
76 76
     }
77 77
 
78 78
     @Test
79 79
     @Ignore
80
-    public void Two_straights()
80
+    public void TwoStraights()
81 81
     {
82 82
         final String straightTo8 = "4S 6H 7S 8D 5H";
83 83
         final String straightTo9 = "5S 7H 8S 9D 6H";
84
-        assertEquals(Arrays.asList(straightTo9 ), Poker.BestHands(Arrays.asList(straightTo8, straightTo9 )));
84
+        assertEquals(Arrays.asList(straightTo9 ), Poker.bestHands(Arrays.asList(straightTo8, straightTo9 )));
85 85
 
86 86
         final String straightTo1 = "AS QH KS TD JH";
87 87
         final String straightTo5 = "4S AH 3S 2D 5H";
88
-        assertEquals(Arrays.asList(straightTo1), Poker.BestHands(Arrays.asList(straightTo1, straightTo5)));
88
+        assertEquals(Arrays.asList(straightTo1), Poker.bestHands(Arrays.asList(straightTo1, straightTo5)));
89 89
     }
90 90
 
91 91
     @Test
92 92
     @Ignore
93
-    public void Straight_vs_flush()
93
+    public void StraightVsFlush()
94 94
     {
95 95
         final String straightTo8 = "4S 6H 7S 8D 5H";
96 96
         final String flushTo7 = "2S 4S 5S 6S 7S";
97
-        assertEquals(Arrays.asList(flushTo7 ), Poker.BestHands(Arrays.asList(straightTo8, flushTo7 )));
97
+        assertEquals(Arrays.asList(flushTo7 ), Poker.bestHands(Arrays.asList(straightTo8, flushTo7 )));
98 98
     }
99 99
 
100 100
     @Test
101 101
     @Ignore
102
-    public void Two_flushes()
102
+    public void TwoFlushes()
103 103
     {
104 104
         final String flushTo8 = "3H 6H 7H 8H 5H";
105 105
         final String flushTo7 = "2S 4S 5S 6S 7S";
106
-        assertEquals(Arrays.asList(flushTo8), Poker.BestHands(Arrays.asList(flushTo8, flushTo7)));
106
+        assertEquals(Arrays.asList(flushTo8), Poker.bestHands(Arrays.asList(flushTo8, flushTo7)));
107 107
     }
108 108
 
109 109
     @Test
110 110
     @Ignore
111
-    public void Flush_vs_full()
111
+    public void FlushVsFull()
112 112
     {
113 113
         final String flushTo8 = "3H 6H 7H 8H 5H";
114 114
         final String full = "4S 5H 4S 5D 4H";
115
-        assertEquals(Arrays.asList(full ), Poker.BestHands(Arrays.asList(full, flushTo8)));
115
+        assertEquals(Arrays.asList(full ), Poker.bestHands(Arrays.asList(full, flushTo8)));
116 116
     }
117 117
 
118 118
     @Test
119 119
     @Ignore
120
-    public void Two_fulls()
120
+    public void TwoFulls()
121 121
     {
122 122
         final String fullOf4By9 = "4H 4S 4D 9S 9D";
123 123
         final String fullOf5By8 = "5H 5S 5D 8S 8D";
124
-        assertEquals(Arrays.asList(fullOf5By8 ), Poker.BestHands(Arrays.asList(fullOf4By9, fullOf5By8)));
124
+        assertEquals(Arrays.asList(fullOf5By8 ), Poker.bestHands(Arrays.asList(fullOf4By9, fullOf5By8)));
125 125
     }
126 126
 
127 127
     @Test
128 128
     @Ignore
129
-    public void Full_vs_square()
129
+    public void FullVsSquare()
130 130
     {
131 131
         final String full = "4S 5H 4S 5D 4H";
132 132
         final String squareOf3 = "3S 3H 2S 3D 3H";
133
-        assertEquals(Arrays.asList(squareOf3 ), Poker.BestHands(Arrays.asList(full, squareOf3 )));
133
+        assertEquals(Arrays.asList(squareOf3 ), Poker.bestHands(Arrays.asList(full, squareOf3 )));
134 134
     }
135 135
 
136 136
     @Test
137 137
     @Ignore
138
-    public void Two_squares()
138
+    public void TwoSquares()
139 139
     {
140 140
         final String squareOf2 = "2S 2H 2S 8D 2H";
141 141
         final String squareOf5 = "4S 5H 5S 5D 5H";
142
-        assertEquals(Arrays.asList(squareOf5), Poker.BestHands(Arrays.asList(squareOf2, squareOf5)));
142
+        assertEquals(Arrays.asList(squareOf5), Poker.bestHands(Arrays.asList(squareOf2, squareOf5)));
143 143
     }
144 144
 
145 145
     @Test
146 146
     @Ignore
147
-    public void Square_vs_straight_flush()
147
+    public void SquareVsStraightFlush()
148 148
     {
149 149
         final String squareOf5 = "4S 5H 5S 5D 5H";
150 150
         final String straightFlushTo9 = "5S 7S 8S 9S 6S";
151
-        assertEquals(Arrays.asList(straightFlushTo9 ), Poker.BestHands(Arrays.asList(squareOf5, straightFlushTo9 )));
151
+        assertEquals(Arrays.asList(straightFlushTo9 ), Poker.bestHands(Arrays.asList(squareOf5, straightFlushTo9 )));
152 152
     }
153 153
 
154 154
     @Test
155 155
     @Ignore
156
-    public void Two_straight_flushes()
156
+    public void TwoStraightFlushes()
157 157
     {
158 158
         final String straightFlushTo8 = "4H 6H 7H 8H 5H";
159 159
         final String straightFlushTo9 = "5S 7S 8S 9S 6S";
160
-        assertEquals(Arrays.asList(straightFlushTo9 ), Poker.BestHands(Arrays.asList(straightFlushTo8, straightFlushTo9)));
160
+        assertEquals(Arrays.asList(straightFlushTo9 ), Poker.bestHands(Arrays.asList(straightFlushTo8, straightFlushTo9)));
161 161
     }
162 162
 
163 163
     @Test
164 164
     @Ignore
165
-    public void Three_hand_with_tie()
165
+    public void ThreeHandWithTie()
166 166
     {
167 167
         final String spadeStraightTo9 = "9S 8S 7S 6S 5S";
168 168
         final String diamondStraightTo9 = "9D 8D 7D 6D 5D";
169 169
         final String threeOf4 = "4D 4S 4H QS KS";
170
-        assertEquals(Arrays.asList(spadeStraightTo9, diamondStraightTo9), Poker.BestHands(Arrays.asList(spadeStraightTo9, diamondStraightTo9, threeOf4)));
170
+        assertEquals(Arrays.asList(spadeStraightTo9, diamondStraightTo9), Poker.bestHands(Arrays.asList(spadeStraightTo9, diamondStraightTo9, threeOf4)));
171 171
     }
172 172
 
173 173
     @Test
174 174
     @Ignore
175
-    public void Straight_to_5_against_a_pair_of_jacks()
175
+    public void StraightTo5AgainstAPairOfJacks()
176 176
     {
177 177
         final String straightTo5 = "2S 4D 5C 3S AS";
178 178
         final String twoJacks = "JD 8D 7D JC 5D";
179
-        assertEquals(Arrays.asList(straightTo5), Poker.BestHands(Arrays.asList(straightTo5, twoJacks)));
179
+        assertEquals(Arrays.asList(straightTo5), Poker.bestHands(Arrays.asList(straightTo5, twoJacks)));
180 180
     }
181 181
 }