diff --git a/README.md b/README.md index aa0a41866c..6174a49de7 100644 --- a/README.md +++ b/README.md @@ -208,6 +208,33 @@ int total = new LengthOf( ).intValue(); ``` +To create a set of elements by providing variable arguments: + +```java +final Set unique = new SetOf( + "one", + "two", + "one", + "three" +); +``` + +To create a set of elements from existing iterable: +```java +final Set words = new SetOf<>( + new IterableOf<>("abc", "bcd", "abc", "ccc") +); +``` + +To create a sorted iterable with unique elements from existing iterable: +```java +final Iterable sorted = new Sorted<>( + new SetOf<>( + new IterableOf<>("abc", "bcd", "abc", "ccc") + ) +); +``` + ## Funcs and Procs This is a traditional `foreach` loop: