``` @Test fun testPopOnlyOnce() { ...
# rx
s
Copy code
@Test
    fun testPopOnlyOnce() {
        bitmapStack.push(bitmap)

        bitmapStack.pop().subscribe(testSubscriber)
        testSubscriber.assertNoErrors()
        testSubscriber.onNextEvents
        testSubscriber.assertCompleted()
        testSubscriber.assertTerminalEvent()

        val testErrorSubscriber = TestSubscriber<Bitmap>()

        bitmapStack.pop().subscribe(testErrorSubscriber)
        val error = testErrorSubscriber.onErrorEvents
        assertNotNull(error)
        assertFalse(error.isEmpty())
        assertEquals("No bitmap on the stack",error[0].message)
    }