Inference, Targeting and Compatibility in a Type System for Java with SAM Typed Closures