We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent caf05bf commit 1746789Copy full SHA for 1746789
junit-platform-commons/src/main/java/org/junit/platform/commons/util/CollectionUtils.java
@@ -61,7 +61,7 @@ private CollectionUtils() {
61
* @throws PreconditionViolationException if the collection is {@code null}
62
* or does not contain exactly one element
63
*/
64
- public static <T extends @Nullable Object> T getOnlyElement(Collection<T> collection) {
+ public static <T> T getOnlyElement(Collection<T> collection) {
65
Preconditions.notNull(collection, "collection must not be null");
66
Preconditions.condition(collection.size() == 1,
67
() -> "collection must contain exactly one element: " + collection);
0 commit comments