public static < T > T flattenOption ( scala . Option < T > option ) { if ( option . isEmpty ( ) ) { return null ; } else { return option . get ( ) ; } }
Flattens an option into its value or else null which is not great but is usually more convenient in Java .