class HashTreeUtil {

  public static Bytes32 hash_tree_root(SSZTypes sszType, Bytes... bytes) {
    switch (sszType) {
      case BASIC:
        return hash_tree_root_basic_type(bytes);
      case BITLIST:
        throw new UnsupportedOperationException(
            "Use HashTreeUtil.hash_tree_root(SSZType.BITLIST, int, Bytes...) for a bitlist type.");
      case VECTOR_OF_BASIC:
        return hash_tree_root_vector_of_basic_type(bytes);
      case VECTOR_OF_COMPOSITE:
        throw new UnsupportedOperationException(
            "Use HashTreeUtil.hash_tree_root(SSZTypes.TUPLE_OF_COMPOSITE, List) for a fixed length list of composite SSZ types.");
      case LIST_OF_BASIC:
        throw new UnsupportedOperationException(
            "Use HashTreeUtil.hash_tree_root(SSZType.LIST_OF_BASIC, int, Bytes...) for a variable length list of basic SSZ type.");
      case LIST_OF_COMPOSITE:
        throw new UnsupportedOperationException(
            "Use HashTreeUtil.hash_tree_root(SSZTypes.LIST_COMPOSITE, List) for a variable length list of composite SSZ types.");
      case CONTAINER:
        throw new UnsupportedOperationException(
            "hash_tree_root of SSZ Containers (often implemented by POJOs) must be done by the container POJO itself, as its individual fields cannot be enumerated without reflection.");
      default:
        break;
    }
    return Bytes32.ZERO;
  }

}