* Use java 11 * Use .of - Replace Arrays.asList with List.of - Replace HashSet<>(List.of()) with Set.of * Formatting
This commit is contained in:
@ -23,7 +23,6 @@
|
||||
|
||||
package com.iluwatar.observer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@ -36,12 +35,11 @@ public class HobbitsTest extends WeatherObserverTest<Hobbits> {
|
||||
|
||||
@Override
|
||||
public Collection<Object[]> dataProvider() {
|
||||
final List<Object[]> testData = new ArrayList<>();
|
||||
testData.add(new Object[]{WeatherType.SUNNY, "The happy hobbits bade in the warm sun."});
|
||||
testData.add(new Object[]{WeatherType.RAINY, "The hobbits look for cover from the rain."});
|
||||
testData.add(new Object[]{WeatherType.WINDY, "The hobbits hold their hats tightly in the windy weather."});
|
||||
testData.add(new Object[]{WeatherType.COLD, "The hobbits are shivering in the cold weather."});
|
||||
return testData;
|
||||
return List.of(
|
||||
new Object[]{WeatherType.SUNNY, "The happy hobbits bade in the warm sun."},
|
||||
new Object[]{WeatherType.RAINY, "The hobbits look for cover from the rain."},
|
||||
new Object[]{WeatherType.WINDY, "The hobbits hold their hats tightly in the windy weather."},
|
||||
new Object[]{WeatherType.COLD, "The hobbits are shivering in the cold weather."});
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -23,7 +23,6 @@
|
||||
|
||||
package com.iluwatar.observer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@ -36,12 +35,11 @@ public class OrcsTest extends WeatherObserverTest<Orcs> {
|
||||
|
||||
@Override
|
||||
public Collection<Object[]> dataProvider() {
|
||||
final List<Object[]> testData = new ArrayList<>();
|
||||
testData.add(new Object[]{WeatherType.SUNNY, "The sun hurts the orcs' eyes."});
|
||||
testData.add(new Object[]{WeatherType.RAINY, "The orcs are dripping wet."});
|
||||
testData.add(new Object[]{WeatherType.WINDY, "The orc smell almost vanishes in the wind."});
|
||||
testData.add(new Object[]{WeatherType.COLD, "The orcs are freezing cold."});
|
||||
return testData;
|
||||
return List.of(
|
||||
new Object[]{WeatherType.SUNNY, "The sun hurts the orcs' eyes."},
|
||||
new Object[]{WeatherType.RAINY, "The orcs are dripping wet."},
|
||||
new Object[]{WeatherType.WINDY, "The orc smell almost vanishes in the wind."},
|
||||
new Object[]{WeatherType.COLD, "The orcs are freezing cold."});
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -25,7 +25,6 @@ package com.iluwatar.observer.generic;
|
||||
|
||||
import com.iluwatar.observer.WeatherType;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@ -38,12 +37,12 @@ public class GHobbitsTest extends ObserverTest<GHobbits> {
|
||||
|
||||
@Override
|
||||
public Collection<Object[]> dataProvider() {
|
||||
final List<Object[]> testData = new ArrayList<>();
|
||||
testData.add(new Object[]{WeatherType.SUNNY, "The happy hobbits bade in the warm sun."});
|
||||
testData.add(new Object[]{WeatherType.RAINY, "The hobbits look for cover from the rain."});
|
||||
testData.add(new Object[]{WeatherType.WINDY, "The hobbits hold their hats tightly in the windy weather."});
|
||||
testData.add(new Object[]{WeatherType.COLD, "The hobbits are shivering in the cold weather."});
|
||||
return testData;
|
||||
return List.of(
|
||||
new Object[]{WeatherType.SUNNY, "The happy hobbits bade in the warm sun."},
|
||||
new Object[]{WeatherType.RAINY, "The hobbits look for cover from the rain."},
|
||||
new Object[]{WeatherType.WINDY, "The hobbits hold their hats tightly in the windy weather."},
|
||||
new Object[]{WeatherType.COLD, "The hobbits are shivering in the cold weather."}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -25,7 +25,6 @@ package com.iluwatar.observer.generic;
|
||||
|
||||
import com.iluwatar.observer.WeatherType;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@ -38,12 +37,12 @@ public class OrcsTest extends ObserverTest<GOrcs> {
|
||||
|
||||
@Override
|
||||
public Collection<Object[]> dataProvider() {
|
||||
final List<Object[]> testData = new ArrayList<>();
|
||||
testData.add(new Object[]{WeatherType.SUNNY, "The sun hurts the orcs' eyes."});
|
||||
testData.add(new Object[]{WeatherType.RAINY, "The orcs are dripping wet."});
|
||||
testData.add(new Object[]{WeatherType.WINDY, "The orc smell almost vanishes in the wind."});
|
||||
testData.add(new Object[]{WeatherType.COLD, "The orcs are freezing cold."});
|
||||
return testData;
|
||||
return List.of(
|
||||
new Object[]{WeatherType.SUNNY, "The sun hurts the orcs' eyes."},
|
||||
new Object[]{WeatherType.RAINY, "The orcs are dripping wet."},
|
||||
new Object[]{WeatherType.WINDY, "The orc smell almost vanishes in the wind."},
|
||||
new Object[]{WeatherType.COLD, "The orcs are freezing cold."}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user