All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dev.failsafe.internal.util.Lists Maven / Gradle / Ivy

package dev.failsafe.internal.util;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * List utilities.
 *
 * @author Jonathan Halterman
 */
public final class Lists {
  private Lists() {
  }

  /**
   * Returns a list containing the {@code first} element followed by the {@code rest}.
   */
  public static  List of(T first, T[] rest) {
    List result = new ArrayList<>(rest.length + 1);
    result.add(first);
    Collections.addAll(result, rest);
    return result;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy