1 /* 2 * Copyright (C) 2011, Christian Halstrick <christian.halstrick@sap.com> and others 3 * 4 * This program and the accompanying materials are made available under the 5 * terms of the Eclipse Distribution License v. 1.0 which is available at 6 * https://www.eclipse.org/org/documents/edl-v10.php. 7 * 8 * SPDX-License-Identifier: BSD-3-Clause 9 */ 10 11 package org.eclipse.jgit.lib; 12 13 import java.util.Arrays; 14 import java.util.HashSet; 15 import java.util.Set; 16 17 public class Sets { 18 @SafeVarargs 19 public static <T> Set<T> of(T... elements) { 20 Set<T> ret = new HashSet<>(); 21 ret.addAll(Arrays.asList(elements)); 22 return ret; 23 } 24 }