code: public static Set<Field> getAllStaticFields(Class<?> type) {
          final Set<Field> fields = new LinkedHashSet<Field>();
          final Field[] declaredFields = type.getDeclaredFields();
          for (Field field : declaredFields) {
              if (Modifier.isStatic(field.getModifiers())) {
                  field.setAccessible(true);
                  fields.add(field);
              }
          }
          return fields;
      }
docs: Get all static fields for a particular type.
  
  @param type The class whose static fields to get.
  @return All static fields in . All fields are set to accessible.