Find the first missing positive integer in an array of integers
Instead of 

if (res.isPresent()) {
    return res.getAsInt()+1;
}

return inputArray.length+1;


you could make use of the orElse method of OptionalInt:

return res.orElse(inputArray.length) + 1;