First time here? Check out the FAQ!
I think java equivalent of C++ hierarchy[k] will be hierarchy.get(0, k).
hierarchy[k]
hierarchy.get(0, k)