8000 Updated test case for PR 974 by lhazlewood · Pull Request #991 · jwtk/jjwt · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Updated test case for PR 974 #991

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions api/src/main/java/io/jsonwebtoken/lang/Collections.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,16 @@ public static <T> List<T> of(T... elements) {
/**
* Returns the specified collection as a {@link Set} instance.
*
* @param c the collection to represent as a set
* @param c the collection to be converted
* @param <T> collection element type
* @return a type-safe immutable {@code Set} containing the specified collection elements.
* @return a type-safe immutable {@code Set} containing the specified collection elements.
* @since 0.12.0
*/
public static <T> Set<T> asSet(Collection<T> c) {
if (c instanceof Set) {
return (Set<T>) c;
}
if (isEmpty(c)) {
return java.util.Collections.emptySet();
}
return java.util.Collections.unmodifiableSet(new LinkedHashSet<>(c));
return java.util.Collections.unmodifiableSet(new LinkedHashSet<T>(c));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class CollectionsTest {
@Test
void testAsSetFromSet() {
def set = Collections.setOf('foo')
assertSame set, Collections.asSet(set)
assertEquals set, Collections.asSet(set)
}

@Test
Expand Down
0