### Question:
Range implements Iterable<Integer>, Serializable { private Range(int begin, int end) { this.begin = begin; this.end = end; } private  Range(int begin, int end); int begin(); int end(); boolean contains(int value); int size(); Sequence<Integer> collect(); Sequence<T> map(Function1<? super Integer, ? extends T> map); IntStream intStream(); Stream<Integer> stream(); @Override Iterator<Integer> iterator(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); static Range of(int begin, int end);  }### Answer:
@Test public void range() { Range range = Range.of(1, 10); assertAll( () -> assertThrows(IllegalArgumentException.class, () -> Range.of(1, 0)), () -> assertEquals(0, Range.of(1, 1).size()), () -> assertEquals(1, range.begin()), () -> assertEquals(10, range.end()), () -> assertEquals(9, range.size()), () -> assertFalse(range.contains(0)), () -> assertFalse(range.contains(10)), () -> assertTrue(range.contains(1)), () -> assertEquals(arrayOf(1, 2, 3, 4, 5, 6, 7, 8, 9), range.collect()) ); }