@ SuppressWarnings ( "OptionalUsedAsFieldOrParameterType" ) public static < T , U > T iff ( Optional < U > optional , Function < U , T > ifFunction ) { if ( Objects . nonNull ( optional ) && optional . isPresent ( ) ) { return optional . map ( ifFunction ) . orElse ( null ) ; } return null ; }
Generic if - expression to if ing inside method calls