BEAL-1985 - Removed Java 9 Example (#4734)

* Added Class for Initalizing HahsSet

* Updated Class name

* Delete InitializingSetTest.java

* Modified HashSet Initilization Example

* Removed Java 9 Example

* Update HashSetInitalizingUnitTest.java

* Update HashSetInitalizingUnitTest.java

* Update HashSetInitalizingUnitTest.java

* Update HashSetInitalizingUnitTest.java
This commit is contained in:
micropatel 2018-07-20 02:39:42 -03:00 committed by maibin
parent 416a88eae5
commit dbe99c2951
1 changed files with 3 additions and 14 deletions

View File

@ -50,22 +50,9 @@ public class HashSetInitalizingUnitTest {
@Test
public void whenUsingJava8_usingCollectOnStream_thenCorrectSize() {
Set<String> set = Stream.of("a", "b", "c").collect(Collectors.toSet());
Set<String> set = Stream.of("a", "b", "c").collect(Collectors.toCollection(HashSet::new));
assertEquals(3, set.size());
}
@Test
public void whenUsingJava8_fromStringArray_thenCorrectSize() {
String[] stringArray = {"a","b","c"};
Set<String> set = Arrays.stream(stringArray).collect(Collectors.toCollection(HashSet::new));
assertEquals(3, set.size());
}
// Requires Java9 - uncomment if you are using Java 9 or higher
/*@Test
public void whenUsingJava9_usingCollectOnStream_thenCorrectSize() {
Set set = Set.of("a", "b", "c");
assertEquals(3, set.size());
}*/
@Test
public void whenUsingGoogleGuava_createMutableSet_thenCorrectSize() {
@ -78,4 +65,6 @@ public class HashSetInitalizingUnitTest {
Set<String> set = ImmutableSet.of("a", "b", "c");
assertEquals(3, set.size());
}
}