It would have to return Integer; you can't turn a formal type parameter into a primitive. I suggest you start by writing a method (the shorter the better) which includes that code, and view its bytecode with javap.
Looking at the bytecode, really? Do you mean you can compile it too? We might not be using the same compiler. Mine says: Error:(l, c) java: incompatible types: bad return type in lambda expression
missing return value!
I tried with Oracle JDK 1.8.0_121-b13, Oracle JDK 1.8.0_92-b14, Oracle JDK 1.8.0_77-b03, OpenJDK build 1.8.0_111-b16, and none of these compile this code without error. I would be interested in knowing he exact version used.