class Collection {
    /**
     * Provides a helper method to create a collection converter that will map each element based on the {@code elementConverter}.
     *
     * <pre>
     *   using(Collection.map(String::toUpperCase)).map();
     *   using(Collection.map(ele -> new Destination(ele)).map();
     * </pre>
     *
     * @param elementConverter the converter to map the source element to destination element
     * @param <S> the source element type
     * @param <D> the destination element type
     * @return a Converter
     */
    public static <S, D> org.modelmapper.Converter<java.util.Collection<S>, java.util.Collection<D>> map(final Converter<S, D> elementConverter) {
      return new org.modelmapper.Converter<java.util.Collection<S>, java.util.Collection<D>>() {
        @Override
        public java.util.Collection<D> convert(
            MappingContext<java.util.Collection<S>, java.util.Collection<D>> context) {
          if (context.getSource() == null)
            return null;

          java.util.Collection<D> destination = MappingContextHelper.createCollection(context);
          for (S element : context.getSource()) {
            destination.add(elementConverter.convert(element));
          }
          return destination;
        }
      };
    }

    /**
     * Provides a helper method to create a collection converter that will get the first element of source collect and convert it.
     *
     * <pre>
     *   using(Collection.first().to(Destination.class).map();
     * </pre>
     *
     * @param <S> the source type
     * @return a {@code ChainableConverter}
     */
    public static <S> ChainableConverter<java.util.Collection<S>, S> first() {<FILL_FUNCTION_BODY>}

    private Collection() {
    }
  }

      return new ChainableConverter<java.util.Collection<S>, S>() {
        @Override
        public <D> org.modelmapper.Converter<java.util.Collection<S>, D> to(Class<D> destinationType) {
          return new org.modelmapper.Converter<java.util.Collection<S>, D>() {
            @Override
            public D convert(MappingContext<java.util.Collection<S>, D> context) {
              if (context.getSource() == null || context.getSource().isEmpty())
                return null;
              MappingContext<S, D> elementContext = context.create(context.getSource().iterator().next(),
                  context.getDestinationType());
              return context.getMappingEngine().map(elementContext);
            }
          };
        }

        @Override
        public <D> org.modelmapper.Converter<java.util.Collection<S>, D> map(
            final org.modelmapper.Converter<S, D> converter) {
          return new org.modelmapper.Converter<java.util.Collection<S>, D>() {
            @Override
            public D convert(MappingContext<java.util.Collection<S>, D> context) {
              if (context.getSource() == null || context.getSource().isEmpty())
                return null;
              MappingContext<S, D> elementContext = context.create(context.getSource().iterator().next(),
                  context.getDestinationType());
              return converter.convert(elementContext);
            }
          };
        }
      };
    
<no_super_class>