Why would you need to?
If isPresent is false, what value are you returning to your caller?
Sounds like a great use of orElse(default_value)
Or taking whatever your public int getAmount(ICapabilityProvider obj) { ... } method is and shoving that, in its entirety, into the place where it is being called and putting it inside an ifPresent.
The only valid use for isPresent is checking to see if the capability exists and doing something with only the information that it exists. You don't care what data is in it, only that it exists.