minus-squarepresumably_wrong@lemm.eetoJava@programming.dev•What are some things in the class library you wish more people knew about or used?linkfedilinkEnglisharrow-up0·1 year agoInstead of wrapping it in an optional you can do Objects.requireNonNullElse(value, defaultValue) linkfedilink
Instead of wrapping it in an optional you can do
Objects.requireNonNullElse(value, defaultValue)