Java List to Set toSet(List list)

Here you can find the source of toSet(List list)

Description

to Set

License

Open Source License

Declaration

public static <T> Set<T> toSet(List<T> list) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.*;

public class Main {
    public static <T> Set<T> toSet(List<T> list) {
        return Collections.unmodifiableSet(new HashSet<>(list));
    }//w  w w.j  av  a 2s  . c o  m
}

Related

  1. listToSet(final BsonArray array)
  2. listToSet(List list)
  3. toSet(List sources)
  4. toSet(List list, Comparator comparator)
  5. toSet(List list)
  6. toSet(Optional> list)

  7. HOME | Copyright © www.java2s.com 2016