Skip to content
Merged
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
3 changes: 3 additions & 0 deletions src/main/java/io/reactivex/Observable.java
Original file line number Diff line number Diff line change
Expand Up @@ -3595,6 +3595,9 @@ public static Observable<Long> timer(long delay, TimeUnit unit) {
* time units to use for {@code delay}
* @param scheduler
* the {@link Scheduler} to use for scheduling the item
* @throws NullPointerException
* if {@code unit} is null, or
* if {@code scheduler} is null
* @return an Observable that emits {@code 0L} after a specified delay, on a specified Scheduler, and then
* completes
* @see <a href="http://reactivex.io/documentation/operators/timer.html">ReactiveX operators documentation: Timer</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,27 @@ public void hashCodeOf() {
}

@Test
public void compare() {
public void verifyPositiveInt() throws Exception{
assertEquals(1, ObjectHelper.verifyPositive(1, "param"));
}

@Test
public void verifyPositiveLong() throws Exception{
assertEquals(1L, ObjectHelper.verifyPositive(1L, "param"));
}

@Test(expected = IllegalArgumentException.class)
public void verifyPositiveIntFail() throws Exception{
assertEquals(-1, ObjectHelper.verifyPositive(-1, "param"));
}

@Test(expected = IllegalArgumentException.class)
public void verifyPositiveLongFail() throws Exception{
assertEquals(-1L, ObjectHelper.verifyPositive(-1L, "param"));
}

@Test
public void compare() {
assertEquals(-1, ObjectHelper.compare(0, 2));
assertEquals(0, ObjectHelper.compare(0, 0));
assertEquals(1, ObjectHelper.compare(2, 0));
Expand Down