Java Lambda Function Throw Exception In Python