Просмотр исходного кода

Fixes #716 remove redundant type params

Tyler Matthews 9 лет назад
Родитель
Сommit
2d2b4f8d29

+ 1
- 1
exercises/word-count/src/example/java/WordCount.java Просмотреть файл

6
 public class WordCount {
6
 public class WordCount {
7
 
7
 
8
     public Map<String, Integer> phrase( String input ) {
8
     public Map<String, Integer> phrase( String input ) {
9
-        Map<String, Integer> countMap = new HashMap<String, Integer>();
9
+        Map<String, Integer> countMap = new HashMap<>();
10
         input = input.trim().toLowerCase().replaceAll("[\\W]", " ");
10
         input = input.trim().toLowerCase().replaceAll("[\\W]", " ");
11
         final String[] tokenizedInput = input.split("\\s+");
11
         final String[] tokenizedInput = input.split("\\s+");
12
         for( String aWord : tokenizedInput ) {
12
         for( String aWord : tokenizedInput ) {

+ 1
- 1
exercises/word-count/src/test/java/WordCountTest.java Просмотреть файл

18
     @Before
18
     @Before
19
     public void setup() {
19
     public void setup() {
20
         wordCount = new WordCount();
20
         wordCount = new WordCount();
21
-        expectedWordCount = new HashMap<String, Integer>();
21
+        expectedWordCount = new HashMap<>();
22
     }
22
     }
23
 
23
 
24
 
24