how to get data from array list to set java

Solutions on MaxInterview for how to get data from array list to set java by the best coders in the world

showing results for - "how to get data from array list to set java"
Elena
11 Sep 2019
1public void givenUsingCoreJava_whenListConvertedToSet_thenCorrect() {
2    List<Integer> sourceList = Arrays.asList(0, 1, 2, 3, 4, 5);
3    Set<Integer> targetSet = new HashSet<>(sourceList);
4}
similar questions