private static @NotNull Map<String, Pair<Method, Method>> collectPropertyAccessors(@NotNull Class<?> aClass,
                                                                                     @NotNull List<? super MutableAccessor> accessors,
                                                                                     @NotNull Configuration configuration) {
    // (name,(getter,setter))
    Map<String, Pair<Method, Method>> candidates = new TreeMap<>();
    Class<?> currentClass = aClass;
    do {
      for (Method method : currentClass.getDeclaredMethods()) {
        if (!Modifier.isPublic(method.getModifiers())) {
          continue;
        }

        NameAndIsSetter propertyData = getPropertyData(method.getName());
        if (propertyData == null || method.getParameterCount() != (propertyData.isSetter ? 1 : 0) || propertyData.name.equals("class")) {
          continue;
        }

        Pair<Method, Method> candidate = candidates.get(propertyData.name);
        if (candidate == null) {
          candidate = Pair.empty();
        }
        if ((propertyData.isSetter ? candidate.second : candidate.first) != null) {
          continue;
        }
        candidate = new Pair<>(propertyData.isSetter ? candidate.first : method, propertyData.isSetter ? method : candidate.second);
        candidates.put(propertyData.name, candidate);
      }
    }
    while ((currentClass = currentClass.getSuperclass()) != null && isSerializableClass(configuration, currentClass));

    for (Iterator<Map.Entry<String, Pair<Method, Method>>> iterator = candidates.entrySet().iterator(); iterator.hasNext(); ) {
      Map.Entry<String, Pair<Method, Method>> candidate = iterator.next();
      Pair<Method, Method> methods = candidate.getValue();
      Method getter = methods.first;
      Method setter = methods.second;
      if (isAcceptableProperty(getter, setter, configuration)) {
        accessors.add(new PropertyAccessor(candidate.getKey(), getter.getReturnType(), getter, setter));
      }
      else {
        iterator.remove();
      }
    }
    return candidates;
  }
private static @NotNull Map<String, Pair<Method, Method>> collectPropertyAccessors(@NotNull Class<?> aClass,
                                                                                     @NotNull List<? super MutableAccessor> accessors,
                                                                                     @NotNull Configuration configuration)