I would like to know if there is something like this in Java:
// using JavaScript
let ar = [1,2,3];
Math.max(4, ...ar);
// ^^^
because I have an EnumSet
, and to have a copy of another EnumSet
plus another object, i have to do:
var newES = EnumSet.copyOf(someES);
newES.add(p);
doSomething(newES);
Where I would like to do something like:
doSomething(EnumSet.of(p, ...someES.toArray()));