Dónal
Dónal

Reputation: 187349

empty groovy range

Is it possible to construct an empty range? Something that would satisfy the following test:

  Range emptyRange = // the magic goes here
  assert emptyRange.from == null
  assert emptyRange.to == null

Upvotes: 0

Views: 309

Answers (1)

tim_yates
tim_yates

Reputation: 171124

How about

Range emptyRange = new EmptyRange()

Upvotes: 6

Related Questions