fn assert_exception(res: Result<jobject, Error>, expect_message: &str) {
    assert!(res.is_err());
    assert!(res
        .map_err(|error| match *error.kind() {
            ErrorKind::JavaException => true,
            _ => false,
        })
        .expect_err(expect_message));
}
// Helper method that asserts that result is Error and the cause is JavaException.
Helper method that asserts that result is Error and the cause is JavaException.
Helper method that asserts that result is Error and the cause is JavaException .
fn assert_exception(res: Result<jobject, Error>, expect_message: &str) {
    assert!(res.is_err());
    assert!(res
        .map_err(|error| match *error.kind() {
            ErrorKind::JavaException => true,
            _ => false,
        })
        .expect_err(expect_message));
}
fn assert_exception ( res : Result < jobject , Error > , expect_message : & str ) { assert ! ( res is_err ( ) ) ; assert ! ( res map_err ( error match error kind ( ) { ErrorKind JavaException true false } ) expect_err ( expect_message ) ) ; }
Helper method that asserts that result is Error and the cause is JavaException.
Helper method that asserts that result is Error and the cause is JavaException .
res
Result<jobject, Error>
expect_message
&str