You get the class cast exception because you are expecting an ArraList while the ArrayList.subList()does not return ArrayList.
Change your sibling.keys from ArrayList to List, and should work fine. This will avoid ClassCastException as well as you will not need to and any cast.