Why does this need an unchecked cast?