This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static List<Integer> toList(int[] array) { | |
return Arrays.stream(array).boxed().collect(Collectors.toList()); | |
} | |
public static List<Long> toList(long[] array) { | |
return Arrays.stream(array).boxed().collect(Collectors.toList()); | |
} | |
public static List<Double> toList(double[] array) { | |
return Arrays.stream(array).boxed().collect(Collectors.toList()); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int[] intArray = new int[] { 1, 2, 3 }; | |
UtilsForCollections.toList(intArray); // gives us a compile error! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static <T> Set<T> toSet(T[] array) { | |
return Arrays.stream(array).collect(Collectors.toSet()); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static <T> List<T> toList(T[] array) { | |
return Arrays.stream(array).collect(Collectors.toList()); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static <T> List<T> toList(T[] array) { | |
// TODO implement but how? | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class UtilsForCollections { | |
private UtilsForCollections() { | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class UtilsForCollections { | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# only if you do not add the original repository as upstream | |
git remote add upstream https://github.com/original_github_username/original_github_repo_name.git | |
# then fetch and create a new branch for your pr | |
git fetch --all | |
git checkout -b new-branch-name-for-pr upstream/master | |
# pick the commits you want to include in your pr | |
git cherry-pick a52afa1 | |
git cherry-pick 08f39f7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add our dependencies | |
var gulp = require('gulp'), // Main Gulp module | |
concat = require('gulp-concat'), // Gulp File concatenation plugin | |
open = require('gulp-open'), // Gulp browser opening plugin | |
connect = require('gulp-connect'); // Gulp Web server runner plugin | |
// Configuration | |
var configuration = { | |
paths: { |