public static List<Field> allFields(Class<?> clazz) {
    if (Objects.equals(clazz, Object.class)) {
      return Collections.emptyList();
    }

    List<Field> fields = new ArrayList<>();
    fields.addAll(Arrays.asList(clazz.getDeclaredFields()));
    fields.addAll(allFields(clazz.getSuperclass()));
    return fields;
  }
Copy entire map of string collection.

<p>The copy is unmodifiable map of unmodifiable collections.

@param map string collection map
@return copy of the map or an empty map if the map is null.
core/src/main/java/feign/Util.java