private static boolean areDuplicateMethodDescriptors(
      FactoryMethodDescriptor factory, ImplementationMethodDescriptor implementation) {

    if (!factory.name().equals(implementation.name())) {
      return false;
    }

    // Descriptors are identical if they have the same passed types in the same order.
    return Iterables.elementsEqual(
        Iterables.transform(factory.passedParameters(), Parameter::type),
        Iterables.transform(implementation.passedParameters(), Parameter::type));
  }
Returns true if the given {@link FactoryMethodDescriptor} and {@link
ImplementationMethodDescriptor} are duplicates.

<p>Descriptors are duplicates if they have the same name and if they have the same passed types
in the same order.
factory/src/main/java/com/google/auto/factory/processor/FactoryDescriptor.java