Skip to content

Commit

Permalink
Changed toTest to support SortedSet
Browse files Browse the repository at this point in the history
  • Loading branch information
NelsonNew committed Jul 27, 2022
1 parent 5e9acb2 commit 83483b4
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;

import org.assertj.core.api.SoftAssertions;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -182,6 +184,8 @@ private Object createInstance(Class<?> type) throws InstantiationException, Ille
o = type.getEnumConstants()[0];
} else if (List.class.isAssignableFrom(type)) {
o = new ArrayList<>();
} else if (SortedSet.class.isAssignableFrom(type)) {
o = new TreeSet<>();
} else if (Set.class.isAssignableFrom(type)) {
o = new HashSet<>();
} else if (Map.class.isAssignableFrom(type)) {
Expand Down

0 comments on commit 83483b4

Please sign in to comment.