// Trying to return a list containing the values in 'a' by traversing the nodes in postorder. In Junit it says that "String cannot be cast to List". Help please.
public static List postorder(Tree a) {
if (a.getEmpty())
return List.empty();
else
postorder(a.getLeft());
postorder(a.getRight());
return ListOps.append(postorder(a.getLeft()),
List.cons(a.getValue(), postorder(a.getRight())));
}