### Question:
RxViewBinder { public void bind() { unbind(); compositeDisposable = new CompositeDisposable(); bindInternal(compositeDisposable); }  void bind(); void unbind();  }### Answer:
@Test public void testBind() throws Exception { binder.bind(); testSubject.onNext("testString"); assertNotNull(testObserver); assertFalse(testObserver.isDisposed()); assertEquals(1, testObserver.getEvents().get(0).size()); assertEquals("testString", testObserver.getEvents().get(0).get(0)); }
@Test public void testDoubleBind() throws Exception { binder.bind(); TestObserver<String> firstTestObserver = testObserver; testObserver = null; binder.bind(); testSubject.onNext("testString"); assertNotNull(firstTestObserver); assertNotNull(testObserver); assertTrue(firstTestObserver.isDisposed()); assertFalse(testObserver.isDisposed()); assertEquals(0, firstTestObserver.getEvents().get(0).size()); assertEquals(1, testObserver.getEvents().get(0).size()); assertEquals("testString", testObserver.getEvents().get(0).get(0)); }