### Question:
WeaverSubscribeOnComponentMaybe extends WeaverSubscribeOnComponentAbstract<Maybe> { @Override public Maybe build() throws Throwable { return buildComponentInternal(); } WeaverSubscribeOnComponentMaybe(ProceedingJoinPoint joinPoint, WeaverComponent<Maybe> parentWeaverComponent); @Override Maybe build();  }### Answer:
@Test public void build() throws Throwable { when(proceedingJoinPoint.proceed()).thenReturn(Maybe.just(1)); when(parentWeaverComponent.getComponentInfo()).thenReturn(componentInfo); when(proceedingJoinPoint.getArgs()).thenReturn(new Object[]{Schedulers.io()}); WeaverSubscribeOnComponentMaybe weaverOnSubscribeComponentMaybe = new WeaverSubscribeOnComponentMaybe(proceedingJoinPoint, parentWeaverComponent); Maybe maybe = weaverOnSubscribeComponentMaybe.build(); maybe.subscribe(observer); observer.dispose(); observer.assertComplete(); verify(componentInfo).setSubscribeOnScheduler(anyString()); verify(componentInfo).setSubscribeOnThread(anyString()); }
@Test public void buildWithoutParent() throws Throwable { when(proceedingJoinPoint.proceed()).thenReturn(Maybe.just(1)); WeaverSubscribeOnComponentMaybe weaverOnSubscribeComponentMaybe = new WeaverSubscribeOnComponentMaybe(proceedingJoinPoint, null); Maybe maybe = weaverOnSubscribeComponentMaybe.build(); maybe.subscribe(observer); observer.dispose(); observer.assertComplete(); verify(componentInfo, times(0)).setSubscribeOnScheduler(anyString()); verify(componentInfo, times(0)).setSubscribeOnThread(anyString()); }