Skip to content

Commit

Permalink
Adds test case for bounded wildcard generics
Browse files Browse the repository at this point in the history
  • Loading branch information
jqno committed Apr 3, 2024
1 parent 6dfc062 commit 9ab24e3
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.io.Serializable;
import java.util.Objects;
import nl.jqno.equalsverifier.EqualsVerifier;
import nl.jqno.equalsverifier.Warning;
Expand Down Expand Up @@ -141,6 +142,11 @@ public void succeed_whenRecordValidatesInput_givenValidPrefabValues() {
.verify();
}

@Test
public void succeed_whenRecord() {
EqualsVerifier.forClass(WildcardGenericRecordContainer.class).verify();
}

record SimpleRecord(int i, String s) {}

private record PrivateSimpleRecord(int i, String s) {}
Expand Down Expand Up @@ -247,4 +253,8 @@ record ValidatingConstructorRecord(String s) {
}
}
}

record BoundedGenericRecord<T extends Serializable>(T t) {}

record WildcardGenericRecordContainer(BoundedGenericRecord<?> bgr) {}
}

0 comments on commit 9ab24e3

Please sign in to comment.