Change this to

    if (hasNext) {
     _nextObj = read()
    }

to match the project code style (in general it's good to have if blocks delimited with braces in case we expand them)