// Java9+
var integers = Pattern.compile("-?\\d+").matcher(source)
.results() // Stream<MatchResult>
.map(MatchResult::group) // Stream<String>
.map(Integer::valueOf)
.toArray(Integer[]::new);
// Java8
Integer[] integersJ8 = Pattern.compile(",")
.splitAsStream(source)
.map(String::trim)
.map(Integer::valueOf)
.toArray(Integer[]::new);