Improve test style

Get rid of Hamcrest, which is uncommon in this codebase, and
replace as many `assert` statements from other testing frameworks
as is reasonable with little automation by calls to
`kotlin.test.*`.
diff --git a/reactive/kotlinx-coroutines-reactive/test/IntegrationTest.kt b/reactive/kotlinx-coroutines-reactive/test/IntegrationTest.kt
index aaeaa00..3ec0b93 100644
--- a/reactive/kotlinx-coroutines-reactive/test/IntegrationTest.kt
+++ b/reactive/kotlinx-coroutines-reactive/test/IntegrationTest.kt
@@ -5,13 +5,12 @@
 package kotlinx.coroutines.reactive
 
 import kotlinx.coroutines.*
-import org.hamcrest.MatcherAssert.*
-import org.hamcrest.core.*
-import org.junit.*
+import org.junit.Test
 import org.junit.runner.*
 import org.junit.runners.*
 import org.reactivestreams.*
 import kotlin.coroutines.*
+import kotlin.test.*
 
 @RunWith(Parameterized::class)
 class IntegrationTest(
@@ -44,14 +43,14 @@
             // does not send anything
         }
         assertNSE { pub.awaitFirst() }
-        assertThat(pub.awaitFirstOrDefault("OK"), IsEqual("OK"))
-        assertThat(pub.awaitFirstOrNull(), IsNull())
-        assertThat(pub.awaitFirstOrElse { "ELSE" }, IsEqual("ELSE"))
+        assertEquals("OK", pub.awaitFirstOrDefault("OK"))
+        assertNull(pub.awaitFirstOrNull())
+        assertEquals("ELSE", pub.awaitFirstOrElse { "ELSE" })
         assertNSE { pub.awaitLast() }
         assertNSE { pub.awaitSingle() }
         var cnt = 0
         pub.collect { cnt++ }
-        assertThat(cnt, IsEqual(0))
+        assertEquals(0, cnt)
     }
 
     @Test
@@ -60,18 +59,18 @@
             if (delay) delay(1)
             send("OK")
         }
-        assertThat(pub.awaitFirst(), IsEqual("OK"))
-        assertThat(pub.awaitFirstOrDefault("!"), IsEqual("OK"))
-        assertThat(pub.awaitFirstOrNull(), IsEqual("OK"))
-        assertThat(pub.awaitFirstOrElse { "ELSE" }, IsEqual("OK"))
-        assertThat(pub.awaitLast(), IsEqual("OK"))
-        assertThat(pub.awaitSingle(), IsEqual("OK"))
+        assertEquals("OK", pub.awaitFirst())
+        assertEquals("OK", pub.awaitFirstOrDefault("!"))
+        assertEquals("OK", pub.awaitFirstOrNull())
+        assertEquals("OK", pub.awaitFirstOrElse { "ELSE" })
+        assertEquals("OK", pub.awaitLast())
+        assertEquals("OK", pub.awaitSingle())
         var cnt = 0
         pub.collect {
-            assertThat(it, IsEqual("OK"))
+            assertEquals("OK", it)
             cnt++
         }
-        assertThat(cnt, IsEqual(1))
+        assertEquals(1, cnt)
     }
 
     @Test
@@ -83,11 +82,11 @@
                 if (delay) delay(1)
             }
         }
-        assertThat(pub.awaitFirst(), IsEqual(1))
-        assertThat(pub.awaitFirstOrDefault(0), IsEqual(1))
-        assertThat(pub.awaitLast(), IsEqual(n))
-        assertThat(pub.awaitFirstOrNull(), IsEqual(1))
-        assertThat(pub.awaitFirstOrElse { 0 }, IsEqual(1))
+        assertEquals(1, pub.awaitFirst())
+        assertEquals(1, pub.awaitFirstOrDefault(0))
+        assertEquals(n, pub.awaitLast())
+        assertEquals(1, pub.awaitFirstOrNull())
+        assertEquals(1, pub.awaitFirstOrElse { 0 })
         assertIAE { pub.awaitSingle() }
         checkNumbers(n, pub)
         val channel = pub.openSubscription()
@@ -125,9 +124,9 @@
     private suspend fun checkNumbers(n: Int, pub: Publisher<Int>) {
         var last = 0
         pub.collect {
-            assertThat(it, IsEqual(++last))
+            assertEquals(++last, it)
         }
-        assertThat(last, IsEqual(n))
+        assertEquals(n, last)
     }
 
     private inline fun assertIAE(block: () -> Unit) {
@@ -135,7 +134,7 @@
             block()
             expectUnreached()
         } catch (e: Throwable) {
-            assertThat(e, IsInstanceOf(IllegalArgumentException::class.java))
+            assertTrue(e is IllegalArgumentException)
         }
     }
 
@@ -144,7 +143,7 @@
             block()
             expectUnreached()
         } catch (e: Throwable) {
-            assertThat(e, IsInstanceOf(NoSuchElementException::class.java))
+            assertTrue(e is NoSuchElementException)
         }
     }
 }
\ No newline at end of file
diff --git a/reactive/kotlinx-coroutines-reactive/test/IterableFlowTckTest.kt b/reactive/kotlinx-coroutines-reactive/test/IterableFlowTckTest.kt
index 5dfd9d5..906b257 100644
--- a/reactive/kotlinx-coroutines-reactive/test/IterableFlowTckTest.kt
+++ b/reactive/kotlinx-coroutines-reactive/test/IterableFlowTckTest.kt
@@ -8,16 +8,18 @@
 
 import kotlinx.coroutines.flow.*
 import org.junit.*
+import org.junit.Ignore
+import org.junit.Test
 import org.reactivestreams.*
 import org.reactivestreams.tck.*
 
-import org.junit.Assert.*
 import org.reactivestreams.Subscription
 import org.reactivestreams.Subscriber
 import java.util.ArrayList
 import java.util.concurrent.*
 import java.util.concurrent.CountDownLatch
 import java.util.concurrent.ForkJoinPool.commonPool
+import kotlin.test.*
 
 class IterableFlowTckTest : PublisherVerification<Long>(TestEnvironment()) {
 
diff --git a/reactive/kotlinx-coroutines-reactive/test/PublishTest.kt b/reactive/kotlinx-coroutines-reactive/test/PublishTest.kt
index 4ffa074..9e3c07b 100644
--- a/reactive/kotlinx-coroutines-reactive/test/PublishTest.kt
+++ b/reactive/kotlinx-coroutines-reactive/test/PublishTest.kt
@@ -5,10 +5,9 @@
 package kotlinx.coroutines.reactive
 
 import kotlinx.coroutines.*
-import org.hamcrest.core.*
-import org.junit.*
-import org.junit.Assert.*
+import org.junit.Test
 import org.reactivestreams.*
+import kotlin.test.*
 
 class PublishTest : TestBase() {
     @Test
@@ -45,7 +44,7 @@
             }
             override fun onNext(t: Int) {
                 expect(6)
-                assertThat(t, IsEqual(42))
+                assertEquals(42, t)
             }
             override fun onComplete() { expect(8) }
             override fun onError(t: Throwable?) { expectUnreached() }
@@ -72,8 +71,8 @@
             override fun onComplete() { expectUnreached() }
             override fun onError(t: Throwable) {
                 expect(6)
-                assertThat(t, IsInstanceOf(RuntimeException::class.java))
-                assertThat(t.message, IsEqual("OK"))
+                assertTrue(t is RuntimeException)
+                assertEquals("OK", t.message)
             }
         })
         expect(4)
diff --git a/reactive/kotlinx-coroutines-reactive/test/PublisherMultiTest.kt b/reactive/kotlinx-coroutines-reactive/test/PublisherMultiTest.kt
index e238d39..e3b1d3b 100644
--- a/reactive/kotlinx-coroutines-reactive/test/PublisherMultiTest.kt
+++ b/reactive/kotlinx-coroutines-reactive/test/PublisherMultiTest.kt
@@ -5,9 +5,8 @@
 package kotlinx.coroutines.reactive
 
 import kotlinx.coroutines.*
-import org.hamcrest.core.*
-import org.junit.*
-import org.junit.Assert.*
+import org.junit.Test
+import kotlin.test.*
 
 class PublisherMultiTest : TestBase() {
     @Test
@@ -27,6 +26,6 @@
         observable.collect {
             assertTrue(resultSet.add(it))
         }
-        assertThat(resultSet.size, IsEqual(n))
+        assertEquals(n, resultSet.size)
     }
 }
diff --git a/reactive/kotlinx-coroutines-reactive/test/PublisherSubscriptionSelectTest.kt b/reactive/kotlinx-coroutines-reactive/test/PublisherSubscriptionSelectTest.kt
index ef17847..110718a 100644
--- a/reactive/kotlinx-coroutines-reactive/test/PublisherSubscriptionSelectTest.kt
+++ b/reactive/kotlinx-coroutines-reactive/test/PublisherSubscriptionSelectTest.kt
@@ -6,10 +6,10 @@
 
 import kotlinx.coroutines.*
 import kotlinx.coroutines.selects.*
-import org.junit.*
-import org.junit.Assert.*
+import org.junit.Test
 import org.junit.runner.*
 import org.junit.runners.*
+import kotlin.test.*
 
 @RunWith(Parameterized::class)
 class PublisherSubscriptionSelectTest(private val request: Int) : TestBase() {
diff --git a/reactive/kotlinx-coroutines-reactor/test/ConvertTest.kt b/reactive/kotlinx-coroutines-reactor/test/ConvertTest.kt
index 10e05b7..82664a2 100644
--- a/reactive/kotlinx-coroutines-reactor/test/ConvertTest.kt
+++ b/reactive/kotlinx-coroutines-reactor/test/ConvertTest.kt
@@ -8,7 +8,8 @@
 import kotlinx.coroutines.channels.*
 import kotlinx.coroutines.reactive.*
 import org.junit.*
-import org.junit.Assert.*
+import org.junit.Test
+import kotlin.test.*
 
 class ConvertTest : TestBase() {
     @Test
@@ -66,9 +67,9 @@
             null
         }
         val mono1 = d.asMono(Dispatchers.Unconfined)
-        checkMonoValue(mono1, ::assertNull)
+        checkMonoValue(mono1, Assert::assertNull)
         val mono2 = d.asMono(Dispatchers.Unconfined)
-        checkMonoValue(mono2, ::assertNull)
+        checkMonoValue(mono2, Assert::assertNull)
     }
 
     @Test
diff --git a/reactive/kotlinx-coroutines-reactor/test/FluxMultiTest.kt b/reactive/kotlinx-coroutines-reactor/test/FluxMultiTest.kt
index 7203120..0d5f9e2 100644
--- a/reactive/kotlinx-coroutines-reactor/test/FluxMultiTest.kt
+++ b/reactive/kotlinx-coroutines-reactor/test/FluxMultiTest.kt
@@ -7,9 +7,10 @@
 import kotlinx.coroutines.*
 import kotlinx.coroutines.reactive.*
 import org.junit.*
-import org.junit.Assert.*
+import org.junit.Test
 import reactor.core.publisher.*
 import java.io.*
+import kotlin.test.*
 
 class FluxMultiTest : TestBase() {
     @Test
diff --git a/reactive/kotlinx-coroutines-reactor/test/FluxSingleTest.kt b/reactive/kotlinx-coroutines-reactor/test/FluxSingleTest.kt
index a3e9658..3879c62 100644
--- a/reactive/kotlinx-coroutines-reactor/test/FluxSingleTest.kt
+++ b/reactive/kotlinx-coroutines-reactor/test/FluxSingleTest.kt
@@ -7,9 +7,10 @@
 import kotlinx.coroutines.*
 import kotlinx.coroutines.reactive.*
 import org.junit.*
-import org.junit.Assert.*
+import org.junit.Test
 import reactor.core.publisher.*
 import java.time.Duration.*
+import kotlin.test.*
 
 class FluxSingleTest : TestBase() {
 
diff --git a/reactive/kotlinx-coroutines-reactor/test/FluxTest.kt b/reactive/kotlinx-coroutines-reactor/test/FluxTest.kt
index 2562c9d..31f5f5d 100644
--- a/reactive/kotlinx-coroutines-reactor/test/FluxTest.kt
+++ b/reactive/kotlinx-coroutines-reactor/test/FluxTest.kt
@@ -7,7 +7,6 @@
 import kotlinx.coroutines.*
 import kotlinx.coroutines.flow.*
 import kotlinx.coroutines.reactive.*
-import org.hamcrest.core.*
 import org.junit.*
 import org.junit.Test
 import kotlin.test.*
@@ -23,7 +22,7 @@
         expect(2)
         flux.subscribe { value ->
             expect(5)
-            Assert.assertThat(value, IsEqual("OK"))
+            assertEquals("OK", value)
         }
         expect(3)
         yield() // to started coroutine
@@ -42,8 +41,8 @@
             expectUnreached()
         }, { error ->
             expect(5)
-            Assert.assertThat(error, IsInstanceOf(RuntimeException::class.java))
-            Assert.assertThat(error.message, IsEqual("OK"))
+            assertTrue(error is RuntimeException)
+            assertEquals("OK", error.message)
         })
         expect(3)
         yield() // to started coroutine
diff --git a/reactive/kotlinx-coroutines-reactor/test/MonoTest.kt b/reactive/kotlinx-coroutines-reactor/test/MonoTest.kt
index 223ba7b..551988b 100644
--- a/reactive/kotlinx-coroutines-reactor/test/MonoTest.kt
+++ b/reactive/kotlinx-coroutines-reactor/test/MonoTest.kt
@@ -7,15 +7,15 @@
 import kotlinx.coroutines.*
 import kotlinx.coroutines.flow.*
 import kotlinx.coroutines.reactive.*
-import org.hamcrest.core.*
 import org.junit.*
-import org.junit.Assert.*
+import org.junit.Test
 import org.reactivestreams.*
 import reactor.core.publisher.*
 import reactor.util.context.*
 import java.time.*
 import java.time.Duration.*
 import java.util.function.*
+import kotlin.test.*
 
 class MonoTest : TestBase() {
     @Before
@@ -33,7 +33,7 @@
         expect(2)
         mono.subscribe { value ->
             expect(5)
-            assertThat(value, IsEqual("OK"))
+            assertEquals("OK", value)
         }
         expect(3)
         yield() // to started coroutine
@@ -52,8 +52,8 @@
             expectUnreached()
         }, { error ->
             expect(5)
-            assertThat(error, IsInstanceOf(RuntimeException::class.java))
-            assertThat(error.message, IsEqual("OK"))
+            assertTrue(error is RuntimeException)
+            assertEquals("OK", error.message)
         })
         expect(3)
         yield() // to started coroutine
diff --git a/reactive/kotlinx-coroutines-reactor/test/SchedulerTest.kt b/reactive/kotlinx-coroutines-reactor/test/SchedulerTest.kt
index 8bc72c2..bed607c 100644
--- a/reactive/kotlinx-coroutines-reactor/test/SchedulerTest.kt
+++ b/reactive/kotlinx-coroutines-reactor/test/SchedulerTest.kt
@@ -5,12 +5,10 @@
 package kotlinx.coroutines.reactor
 
 import kotlinx.coroutines.*
-import org.hamcrest.core.IsEqual
-import org.hamcrest.core.IsNot
-import org.junit.Assert.assertThat
 import org.junit.Before
 import org.junit.Test
 import reactor.core.scheduler.Schedulers
+import kotlin.test.*
 
 class SchedulerTest : TestBase() {
     @Before
@@ -24,11 +22,11 @@
         val mainThread = Thread.currentThread()
         withContext(Schedulers.single().asCoroutineDispatcher()) {
             val t1 = Thread.currentThread()
-            assertThat(t1, IsNot(IsEqual(mainThread)))
+            assertNotSame(t1, mainThread)
             expect(2)
             delay(100)
             val t2 = Thread.currentThread()
-            assertThat(t2, IsNot(IsEqual(mainThread)))
+            assertNotSame(t2, mainThread)
             expect(3)
         }
         finish(4)
diff --git a/reactive/kotlinx-coroutines-rx2/test/CompletableTest.kt b/reactive/kotlinx-coroutines-rx2/test/CompletableTest.kt
index 04e8697..298b32b 100644
--- a/reactive/kotlinx-coroutines-rx2/test/CompletableTest.kt
+++ b/reactive/kotlinx-coroutines-rx2/test/CompletableTest.kt
@@ -8,9 +8,8 @@
 import io.reactivex.disposables.*
 import io.reactivex.exceptions.*
 import kotlinx.coroutines.*
-import org.hamcrest.core.*
-import org.junit.*
-import org.junit.Assert.*
+import org.junit.Test
+import kotlin.test.*
 
 class CompletableTest : TestBase() {
     @Test
@@ -40,8 +39,8 @@
             expectUnreached()
         }, { error ->
             expect(5)
-            assertThat(error, IsInstanceOf(RuntimeException::class.java))
-            assertThat(error.message, IsEqual("OK"))
+            assertTrue(error is RuntimeException)
+            assertEquals("OK", error.message)
         })
         expect(3)
         yield() // to completable coroutine
@@ -95,7 +94,7 @@
             expectUnreached()
         } catch (e: RuntimeException) {
             finish(4)
-            assertThat(e.message, IsEqual("OK"))
+            assertEquals("OK", e.message)
         }
     }
 
diff --git a/reactive/kotlinx-coroutines-rx2/test/ConvertTest.kt b/reactive/kotlinx-coroutines-rx2/test/ConvertTest.kt
index 758b632..a433665 100644
--- a/reactive/kotlinx-coroutines-rx2/test/ConvertTest.kt
+++ b/reactive/kotlinx-coroutines-rx2/test/ConvertTest.kt
@@ -6,8 +6,9 @@
 
 import kotlinx.coroutines.*
 import kotlinx.coroutines.channels.*
-import org.junit.*
-import org.junit.Assert.*
+import org.junit.Assert
+import org.junit.Test
+import kotlin.test.*
 
 class ConvertTest : TestBase() {
     @Test
@@ -64,9 +65,9 @@
             null
         }
         val maybe1 = d.asMaybe(Dispatchers.Unconfined)
-        checkMaybeValue(maybe1, ::assertNull)
+        checkMaybeValue(maybe1, Assert::assertNull)
         val maybe2 = d.asMaybe(Dispatchers.Unconfined)
-        checkMaybeValue(maybe2, ::assertNull)
+        checkMaybeValue(maybe2, Assert::assertNull)
     }
 
     @Test
diff --git a/reactive/kotlinx-coroutines-rx2/test/FlowAsObservableTest.kt b/reactive/kotlinx-coroutines-rx2/test/FlowAsObservableTest.kt
index ab9e402..0908b34 100644
--- a/reactive/kotlinx-coroutines-rx2/test/FlowAsObservableTest.kt
+++ b/reactive/kotlinx-coroutines-rx2/test/FlowAsObservableTest.kt
@@ -6,9 +6,8 @@
 
 import kotlinx.coroutines.*
 import kotlinx.coroutines.flow.*
-import org.hamcrest.core.*
-import org.junit.*
-import org.junit.Assert.*
+import org.junit.Test
+import kotlin.test.*
 
 class FlowAsObservableTest : TestBase() {
     @Test
@@ -39,7 +38,7 @@
         expect(2)
         observable.subscribe({ expectUnreached() }, { error ->
             expect(4)
-            assertThat(error, IsInstanceOf(RuntimeException::class.java))
+            assertTrue(error is RuntimeException)
             assertEquals("OK", error.message)
         })
         finish(5)
diff --git a/reactive/kotlinx-coroutines-rx2/test/FlowableTest.kt b/reactive/kotlinx-coroutines-rx2/test/FlowableTest.kt
index aebf999..148d1f9 100644
--- a/reactive/kotlinx-coroutines-rx2/test/FlowableTest.kt
+++ b/reactive/kotlinx-coroutines-rx2/test/FlowableTest.kt
@@ -6,7 +6,6 @@
 
 import kotlinx.coroutines.*
 import kotlinx.coroutines.reactive.*
-import org.hamcrest.core.*
 import org.junit.*
 import org.junit.Test
 import kotlin.test.*
@@ -22,7 +21,7 @@
         expect(2)
         observable.subscribe { value ->
             expect(5)
-            Assert.assertThat(value, IsEqual("OK"))
+            assertEquals("OK", value)
         }
         expect(3)
         yield() // to started coroutine
@@ -41,8 +40,8 @@
             expectUnreached()
         }, { error ->
             expect(5)
-            Assert.assertThat(error, IsInstanceOf(RuntimeException::class.java))
-            Assert.assertThat(error.message, IsEqual("OK"))
+            assertTrue(error is RuntimeException)
+            assertEquals("OK", error.message)
         })
         expect(3)
         yield() // to started coroutine
diff --git a/reactive/kotlinx-coroutines-rx2/test/IntegrationTest.kt b/reactive/kotlinx-coroutines-rx2/test/IntegrationTest.kt
index ca7c0ca..4faebbd 100644
--- a/reactive/kotlinx-coroutines-rx2/test/IntegrationTest.kt
+++ b/reactive/kotlinx-coroutines-rx2/test/IntegrationTest.kt
@@ -6,12 +6,11 @@
 
 import io.reactivex.*
 import kotlinx.coroutines.*
-import org.hamcrest.MatcherAssert.*
-import org.hamcrest.core.*
-import org.junit.*
+import org.junit.Test
 import org.junit.runner.*
 import org.junit.runners.*
 import kotlin.coroutines.*
+import kotlin.test.*
 
 @RunWith(Parameterized::class)
 class IntegrationTest(
@@ -44,16 +43,16 @@
             // does not send anything
         }
         assertNSE { observable.awaitFirst() }
-        assertThat(observable.awaitFirstOrDefault("OK"), IsEqual("OK"))
-        assertThat(observable.awaitFirstOrNull(), IsNull())
-        assertThat(observable.awaitFirstOrElse { "ELSE" }, IsEqual("ELSE"))
+        assertEquals("OK", observable.awaitFirstOrDefault("OK"))
+        assertNull(observable.awaitFirstOrNull())
+        assertEquals("ELSE", observable.awaitFirstOrElse { "ELSE" })
         assertNSE { observable.awaitLast() }
         assertNSE { observable.awaitSingle() }
         var cnt = 0
         observable.collect {
             cnt++
         }
-        assertThat(cnt, IsEqual(0))
+        assertEquals(0, cnt)
     }
 
     @Test
@@ -62,18 +61,18 @@
             if (delay) delay(1)
             send("OK")
         }
-        assertThat(observable.awaitFirst(), IsEqual("OK"))
-        assertThat(observable.awaitFirstOrDefault("OK"), IsEqual("OK"))
-        assertThat(observable.awaitFirstOrNull(), IsEqual("OK"))
-        assertThat(observable.awaitFirstOrElse { "ELSE" }, IsEqual("OK"))
-        assertThat(observable.awaitLast(), IsEqual("OK"))
-        assertThat(observable.awaitSingle(), IsEqual("OK"))
+        assertEquals("OK", observable.awaitFirst())
+        assertEquals("OK", observable.awaitFirstOrDefault("OK"))
+        assertEquals("OK", observable.awaitFirstOrNull())
+        assertEquals("OK", observable.awaitFirstOrElse { "ELSE" })
+        assertEquals("OK", observable.awaitLast())
+        assertEquals("OK", observable.awaitSingle())
         var cnt = 0
         observable.collect {
-            assertThat(it, IsEqual("OK"))
+            assertEquals("OK", it)
             cnt++
         }
-        assertThat(cnt, IsEqual(1))
+        assertEquals(1, cnt)
     }
 
     @Test
@@ -85,11 +84,11 @@
                 if (delay) delay(1)
             }
         }
-        assertThat(observable.awaitFirst(), IsEqual(1))
-        assertThat(observable.awaitFirstOrDefault(0), IsEqual(1))
-        assertThat(observable.awaitFirstOrNull(), IsEqual(1))
-        assertThat(observable.awaitFirstOrElse { 0 }, IsEqual(1))
-        assertThat(observable.awaitLast(), IsEqual(n))
+        assertEquals(1, observable.awaitFirst())
+        assertEquals(1, observable.awaitFirstOrDefault(0))
+        assertEquals(1, observable.awaitFirstOrNull())
+        assertEquals(1, observable.awaitFirstOrElse { 0 })
+        assertEquals(n, observable.awaitLast())
         assertIAE { observable.awaitSingle() }
         checkNumbers(n, observable)
         val channel = observable.openSubscription()
@@ -127,9 +126,9 @@
     private suspend fun checkNumbers(n: Int, observable: Observable<Int>) {
         var last = 0
         observable.collect {
-            assertThat(it, IsEqual(++last))
+            assertEquals(++last, it)
         }
-        assertThat(last, IsEqual(n))
+        assertEquals(n, last)
     }
 
 
@@ -138,7 +137,7 @@
             block()
             expectUnreached()
         } catch (e: Throwable) {
-            assertThat(e, IsInstanceOf(IllegalArgumentException::class.java))
+            assertTrue(e is IllegalArgumentException)
         }
     }
 
@@ -147,7 +146,7 @@
             block()
             expectUnreached()
         } catch (e: Throwable) {
-            assertThat(e, IsInstanceOf(NoSuchElementException::class.java))
+            assertTrue(e is NoSuchElementException)
         }
     }
 }
\ No newline at end of file
diff --git a/reactive/kotlinx-coroutines-rx2/test/MaybeTest.kt b/reactive/kotlinx-coroutines-rx2/test/MaybeTest.kt
index deca961..08427dc 100644
--- a/reactive/kotlinx-coroutines-rx2/test/MaybeTest.kt
+++ b/reactive/kotlinx-coroutines-rx2/test/MaybeTest.kt
@@ -10,11 +10,11 @@
 import io.reactivex.functions.*
 import io.reactivex.internal.functions.Functions.*
 import kotlinx.coroutines.*
-import org.hamcrest.core.*
 import org.junit.*
-import org.junit.Assert.*
+import org.junit.Test
 import java.util.concurrent.*
 import java.util.concurrent.CancellationException
+import kotlin.test.*
 
 class MaybeTest : TestBase() {
     @Before
@@ -32,7 +32,7 @@
         expect(2)
         maybe.subscribe { value ->
             expect(5)
-            assertThat(value, IsEqual("OK"))
+            assertEquals("OK", value)
         }
         expect(3)
         yield() // to started coroutine
@@ -67,8 +67,8 @@
             expectUnreached()
         }, { error ->
             expect(5)
-            assertThat(error, IsInstanceOf(RuntimeException::class.java))
-            assertThat(error.message, IsEqual("OK"))
+            assertTrue(error is RuntimeException)
+            assertEquals("OK", error.message)
         })
         expect(3)
         yield() // to started coroutine
diff --git a/reactive/kotlinx-coroutines-rx2/test/ObservableMultiTest.kt b/reactive/kotlinx-coroutines-rx2/test/ObservableMultiTest.kt
index 6971918..074fcf4 100644
--- a/reactive/kotlinx-coroutines-rx2/test/ObservableMultiTest.kt
+++ b/reactive/kotlinx-coroutines-rx2/test/ObservableMultiTest.kt
@@ -6,10 +6,9 @@
 
 import io.reactivex.*
 import kotlinx.coroutines.*
-import org.junit.*
-import org.junit.Assert.*
+import org.junit.Test
 import java.io.*
-import kotlin.experimental.*
+import kotlin.test.*
 
 /**
  * Test emitting multiple values with [rxObservable].
diff --git a/reactive/kotlinx-coroutines-rx2/test/ObservableSingleTest.kt b/reactive/kotlinx-coroutines-rx2/test/ObservableSingleTest.kt
index 7604b4a..4454190 100644
--- a/reactive/kotlinx-coroutines-rx2/test/ObservableSingleTest.kt
+++ b/reactive/kotlinx-coroutines-rx2/test/ObservableSingleTest.kt
@@ -7,8 +7,9 @@
 import io.reactivex.*
 import kotlinx.coroutines.*
 import org.junit.*
-import org.junit.Assert.*
+import org.junit.Test
 import java.util.concurrent.*
+import kotlin.test.*
 
 class ObservableSingleTest : TestBase() {
     @Before
diff --git a/reactive/kotlinx-coroutines-rx2/test/ObservableSubscriptionSelectTest.kt b/reactive/kotlinx-coroutines-rx2/test/ObservableSubscriptionSelectTest.kt
index 28eb807..3cd3bbf 100644
--- a/reactive/kotlinx-coroutines-rx2/test/ObservableSubscriptionSelectTest.kt
+++ b/reactive/kotlinx-coroutines-rx2/test/ObservableSubscriptionSelectTest.kt
@@ -6,8 +6,8 @@
 
 import kotlinx.coroutines.*
 import kotlinx.coroutines.selects.*
-import org.junit.*
-import org.junit.Assert.*
+import org.junit.Test
+import kotlin.test.*
 
 class ObservableSubscriptionSelectTest : TestBase() {
     @Test
diff --git a/reactive/kotlinx-coroutines-rx2/test/ObservableTest.kt b/reactive/kotlinx-coroutines-rx2/test/ObservableTest.kt
index b9f6fe3..4f7fa54 100644
--- a/reactive/kotlinx-coroutines-rx2/test/ObservableTest.kt
+++ b/reactive/kotlinx-coroutines-rx2/test/ObservableTest.kt
@@ -8,7 +8,6 @@
 import io.reactivex.plugins.*
 import kotlinx.coroutines.*
 import kotlinx.coroutines.CancellationException
-import org.hamcrest.core.*
 import org.junit.*
 import org.junit.Test
 import java.util.concurrent.*
@@ -30,7 +29,7 @@
         expect(2)
         observable.subscribe { value ->
             expect(5)
-            Assert.assertThat(value, IsEqual("OK"))
+            assertEquals("OK", value)
         }
         expect(3)
         yield() // to started coroutine
@@ -49,8 +48,8 @@
             expectUnreached()
         }, { error ->
             expect(5)
-            Assert.assertThat(error, IsInstanceOf(RuntimeException::class.java))
-            Assert.assertThat(error.message, IsEqual("OK"))
+            assertTrue(error is RuntimeException)
+            assertEquals("OK", error.message)
         })
         expect(3)
         yield() // to started coroutine
diff --git a/reactive/kotlinx-coroutines-rx2/test/SchedulerTest.kt b/reactive/kotlinx-coroutines-rx2/test/SchedulerTest.kt
index ca98b45..26dbe8f 100644
--- a/reactive/kotlinx-coroutines-rx2/test/SchedulerTest.kt
+++ b/reactive/kotlinx-coroutines-rx2/test/SchedulerTest.kt
@@ -6,11 +6,9 @@
 
 import io.reactivex.schedulers.Schedulers
 import kotlinx.coroutines.*
-import org.hamcrest.core.IsEqual
-import org.hamcrest.core.IsNot
-import org.junit.Assert.assertThat
 import org.junit.Before
 import org.junit.Test
+import kotlin.test.*
 
 class SchedulerTest : TestBase() {
     @Before
@@ -24,11 +22,11 @@
         val mainThread = Thread.currentThread()
         withContext(Schedulers.io().asCoroutineDispatcher()) {
             val t1 = Thread.currentThread()
-            assertThat(t1, IsNot(IsEqual(mainThread)))
+            assertNotSame(t1, mainThread)
             expect(2)
             delay(100)
             val t2 = Thread.currentThread()
-            assertThat(t2, IsNot(IsEqual(mainThread)))
+            assertNotSame(t2, mainThread)
             expect(3)
         }
         finish(4)
diff --git a/reactive/kotlinx-coroutines-rx2/test/SingleTest.kt b/reactive/kotlinx-coroutines-rx2/test/SingleTest.kt
index d9581f8..c66188a 100644
--- a/reactive/kotlinx-coroutines-rx2/test/SingleTest.kt
+++ b/reactive/kotlinx-coroutines-rx2/test/SingleTest.kt
@@ -9,10 +9,10 @@
 import io.reactivex.exceptions.*
 import io.reactivex.functions.*
 import kotlinx.coroutines.*
-import org.hamcrest.core.*
 import org.junit.*
-import org.junit.Assert.*
+import org.junit.Test
 import java.util.concurrent.*
+import kotlin.test.*
 
 class SingleTest : TestBase() {
     @Before
@@ -30,7 +30,7 @@
         expect(2)
         single.subscribe { value ->
             expect(5)
-            assertThat(value, IsEqual("OK"))
+            assertEquals("OK", value)
         }
         expect(3)
         yield() // to started coroutine
@@ -49,8 +49,8 @@
             expectUnreached()
         }, { error ->
             expect(5)
-            assertThat(error, IsInstanceOf(RuntimeException::class.java))
-            assertThat(error.message, IsEqual("OK"))
+            assertTrue(error is RuntimeException)
+            assertEquals("OK", error.message)
         })
         expect(3)
         yield() // to started coroutine