Alonso-del-Arte/toy-examples

Get `nextObject()` to work for lists and sets

Open

#11 opened on Oct 10, 2023

View on GitHub
 (0 comments) (0 reactions) (0 assignees)Java (7 forks)auto 404
good first issuehacktoberfest

Repository metrics

Stars
 (2 stars)
PR merge metrics
 (PR metrics pending)

Description

Hacktoberfest participants wanting to practice test-driven development (TDD) in Java, here's one for you:

Currently nextObject() in randomness.ExtendedRandom only works for arrays. There are stubs for lists and sets that always return either the first object of the list or the first object given by the set's iterator.

Your pull request should have more than one commit. In the first commit, there should be no changes to ExtendedRandom, maybe only to ExtendedRandomTest.

Don't use the same E types that I used for the array tests. Also test that nextObject() called on an empty list or set throws NoSuchElementException.

Contributor guide