// Path: src/main/java/com/github/ferstl/maven/pomenforcers/priority/PriorityOrdering.java
// public class PriorityOrdering<P extends Comparable<? super P>, T> extends Ordering<T> {
// 
//   /**
//    * The priority collection.
//    */
//   private final Collection<P> priorityCollection;
// 
//   /**
//    * Matches the values to be compared with the items in the priority collection.
//    */
//   private final Equivalence<? super P> priorityMatcher;
// 
//   /**
//    * Transforms the type of the objects to be compared into the type of the priority collection. Use
//    * {@link Function#identity()} if the type of the priority collection and the type of the objects to be
//    * compared are the same.
//    */
//   private final Function<T, P> transformer;
// 
// 
//   public PriorityOrdering(Collection<P> prioritizedItems, Function<T, P> transformer, Equivalence<? super P> priorityMatcher) {
//     this.priorityCollection = prioritizedItems;
//     this.priorityMatcher = priorityMatcher;
//     this.transformer = transformer;
//   }
// 
//   public PriorityOrdering(Collection<P> priorityCollection, Function<T, P> transformer) {
//     this(priorityCollection, transformer, Equivalence.equals());
//   }
// 
//   @Override
//   public int compare(T object1, T object2) {
//     P comparable1 = this.transformer.apply(object1);
//     P comparable2 = this.transformer.apply(object2);
// 
//     int rank1 = this.rank(comparable1);
//     int rank2 = this.rank(comparable2);
// 
//     if (rank1 == rank2) {
//       return comparable1.compareTo(comparable2);
//     }
// 
//     return rank1 - rank2;
// 
//   }
// 
//   /**
//    * Determine the priority of the given item by matching it against the priority collection.
//    * The lower the rank, the higher the priority.
//    *
//    * @param item The item to prioritize.
//    * @return The priority of the given item or {@link Integer#MAX_VALUE} if the given item does not
//    * match any element of the priority collection.
//    */
//   private int rank(P item) {
//     int i = 0;
//     for (P prioritizedItem : this.priorityCollection) {
//       if (this.priorityMatcher.equivalent(item, prioritizedItem)) {
//         return i;
//       }
//       i++;
//     }
// 
//     return Integer.MAX_VALUE;
//   }
// 
// }
// 
// Path: src/main/java/com/github/ferstl/maven/pomenforcers/priority/PriorityOrderingFactory.java
// public interface PriorityOrderingFactory<P extends Comparable<? super P>, T> {
//   PriorityOrdering<P, T> createPriorityOrdering(Collection<P> priorityCollection);
// }
// 
// Path: src/main/java/com/github/ferstl/maven/pomenforcers/model/functions/StringStartsWithEquivalence.java
// public static Equivalence<String> stringStartsWith() {
//   return INSTANCE;
// }


import java.util.Collection;
import java.util.Map;
import java.util.function.Function;
import com.github.ferstl.maven.pomenforcers.priority.PriorityOrdering;
import com.github.ferstl.maven.pomenforcers.priority.PriorityOrderingFactory;
import com.google.common.collect.Maps;
import static com.github.ferstl.maven.pomenforcers.model.functions.StringStartsWithEquivalence.stringStartsWith;
import static java.util.Objects.requireNonNull;

/*
 * Copyright (c) 2012 - 2020 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.github.ferstl.maven.pomenforcers.model;



public enum DependencyElement implements PriorityOrderingFactory<String, DependencyModel>, Function<DependencyModel, String> {
  GROUP_ID("groupId") {
    @Override
    public PriorityOrdering<String, DependencyModel> createPriorityOrdering(Collection<String> priorityCollection) {

// Path: src/main/java/com/github/ferstl/maven/pomenforcers/priority/PriorityOrdering.java
// public class PriorityOrdering<P extends Comparable<? super P>, T> extends Ordering<T> {
// 
//   /**
//    * The priority collection.
//    */
//   private final Collection<P> priorityCollection;
// 
//   /**
//    * Matches the values to be compared with the items in the priority collection.
//    */
//   private final Equivalence<? super P> priorityMatcher;
// 
//   /**
//    * Transforms the type of the objects to be compared into the type of the priority collection. Use
//    * {@link Function#identity()} if the type of the priority collection and the type of the objects to be
//    * compared are the same.
//    */
//   private final Function<T, P> transformer;
// 
// 
//   public PriorityOrdering(Collection<P> prioritizedItems, Function<T, P> transformer, Equivalence<? super P> priorityMatcher) {
//     this.priorityCollection = prioritizedItems;
//     this.priorityMatcher = priorityMatcher;
//     this.transformer = transformer;
//   }
// 
//   public PriorityOrdering(Collection<P> priorityCollection, Function<T, P> transformer) {
//     this(priorityCollection, transformer, Equivalence.equals());
//   }
// 
//   @Override
//   public int compare(T object1, T object2) {
//     P comparable1 = this.transformer.apply(object1);
//     P comparable2 = this.transformer.apply(object2);
// 
//     int rank1 = this.rank(comparable1);
//     int rank2 = this.rank(comparable2);
// 
//     if (rank1 == rank2) {
//       return comparable1.compareTo(comparable2);
//     }
// 
//     return rank1 - rank2;
// 
//   }
// 
//   /**
//    * Determine the priority of the given item by matching it against the priority collection.
//    * The lower the rank, the higher the priority.
//    *
//    * @param item The item to prioritize.
//    * @return The priority of the given item or {@link Integer#MAX_VALUE} if the given item does not
//    * match any element of the priority collection.
//    */
//   private int rank(P item) {
//     int i = 0;
//     for (P prioritizedItem : this.priorityCollection) {
//       if (this.priorityMatcher.equivalent(item, prioritizedItem)) {
//         return i;
//       }
//       i++;
//     }
// 
//     return Integer.MAX_VALUE;
//   }
// 
// }
// 
// Path: src/main/java/com/github/ferstl/maven/pomenforcers/priority/PriorityOrderingFactory.java
// public interface PriorityOrderingFactory<P extends Comparable<? super P>, T> {
//   PriorityOrdering<P, T> createPriorityOrdering(Collection<P> priorityCollection);
// }
// 
// Path: src/main/java/com/github/ferstl/maven/pomenforcers/model/functions/StringStartsWithEquivalence.java
// public static Equivalence<String> stringStartsWith() {
//   return INSTANCE;
// }


// Path: src/main/java/com/github/ferstl/maven/pomenforcers/model/DependencyElement.java
import java.util.Collection;
import java.util.Map;
import java.util.function.Function;
import com.github.ferstl.maven.pomenforcers.priority.PriorityOrdering;
import com.github.ferstl.maven.pomenforcers.priority.PriorityOrderingFactory;
import com.google.common.collect.Maps;
import static com.github.ferstl.maven.pomenforcers.model.functions.StringStartsWithEquivalence.stringStartsWith;
import static java.util.Objects.requireNonNull;

/*
 * Copyright (c) 2012 - 2020 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.github.ferstl.maven.pomenforcers.model;



public enum DependencyElement implements PriorityOrderingFactory<String, DependencyModel>, Function<DependencyModel, String> {
  GROUP_ID("groupId") {
    @Override
    public PriorityOrdering<String, DependencyModel> createPriorityOrdering(Collection<String> priorityCollection) {

      return new PriorityOrdering<>(priorityCollection, this, stringStartsWith());
