code: @Nullable
    public static <T> T constValue(Tree tree, Class<? extends T> clazz) {
      Object value = constValue(tree);
      return clazz.isInstance(value) ? clazz.cast(value) : null;
    }
docs: Returns the compile-time constant value of a tree if it is of type clazz, or {@code null}.