code: private static <T> T coalesce(T... values) {
      for (T value : values) {
        if (value != null) {
          return value;
        }
      }
      return null;
    }
docs: Returns the first non-null value from the sequence or null if there is no
  non-null value.