Skip to content

Instantly share code, notes, and snippets.

@yavuztas
Last active August 27, 2019 15:19
Show Gist options
  • Save yavuztas/a5d24ec63e80b55d0f73cfb8dc43bad7 to your computer and use it in GitHub Desktop.
Save yavuztas/a5d24ec63e80b55d0f73cfb8dc43bad7 to your computer and use it in GitHub Desktop.
public static Set<Integer> toSet(int[] array) {
return Arrays.stream(array).boxed().collect(Collectors.toSet());
}
public static Set<Long> toSet(long[] array) {
return Arrays.stream(array).boxed().collect(Collectors.toSet());
}
public static Set<Double> toSet(double[] array) {
return Arrays.stream(array).boxed().collect(Collectors.toSet());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment