Guava has a method that does something similar called MoreObjects.firstNonNull(T,T).
Integer x = ...
int y = MoreObjects.firstNonNull(x, -1);
This is more helpful when you have something like
int y = firstNonNull(calculateNullableValue(), -1);
since it saves you from either calling the potentially expensive method twice or declaring a local variable in your code to reference twice.