asList metodu
Şöyle yaparız
Set<Character> first = ImmutableSet.of('a', 'b', 'c');
Set<Character> second = ImmutableSet.of('b', 'c', 'd');
// here it's ugly but maybe you can collect to set in the first place
ImmutableMultiset<Character> set = ImmutableSet.<Character>builder()
.addAll(first)
.addAll(second)
.build(); // [a, b, c, d]
List<Character> characters = set.asList();
assertThat(characters).containsOnly('a', 'b', 'c', 'd');
Hiç yorum yok:
Yorum Gönder