test_class.declarator: mProxyFactory
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ProxyFactory mProxyFactory;
test_class.type: ProxyFactory
test_class.var_name: mProxyFactory
test_class.declarator: mFailureHandler
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private FailureHandler mFailureHandler;
test_class.type: FailureHandler
test_class.var_name: mFailureHandler
test_class.declarator: mActorImpl
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private Runnable mActorImpl;
test_class.type: Runnable
test_class.var_name: mActorImpl
test_class.declarator: mProxy
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private Runnable mProxy;
test_class.type: Runnable
test_class.var_name: mProxy
test_class.declarator: mMessageSender
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ActorService.RemoteMessageSender mMessageSender;
test_class.type: ActorService.RemoteMessageSender
test_class.var_name: mMessageSender
test_class.declarator: mBinder
test_class.modifier: private
test_class.original_string: private Binder mBinder;
test_class.type: Binder
test_class.var_name: mBinder
test_class.file: actors-library/src/test/java/com/truecaller/androidactors/ServiceActorThreadTest.java
test_class.identifier: ServiceActorThreadTest
test_case.body: @Test
      public void emptyRemoteExceptionTest() throws Exception {
          ShadowApplication application = ShadowApplication.getInstance();
          ComponentName componentName = new ComponentName(application.getApplicationContext(), ActorService.class);
          IBinder binder = Mockito.mock(IBinder.class);
          Mockito.doThrow(new RemoteException()).when(binder).getInterfaceDescriptor();
          ServiceActorThread thread = new ServiceActorThread(application.getApplicationContext(), mProxyFactory,
                  mFailureHandler, ActorService.class, 1);
  
          ActorRef<Runnable> ref = thread.bind(Runnable.class, mActorImpl);
          Assert.assertSame(mProxy, ref.tell());
  
          ArgumentCaptor<MessageSender> postmanCaptor = ArgumentCaptor.forClass(MessageSender.class);
          Mockito.verify(mProxyFactory).newProxy(Mockito.<Class>any(), postmanCaptor.capture());
  
          MessageSender postman = postmanCaptor.getValue();
          Assert.assertNotNull(postman);
  
          // Set null as local interface, it should cause service restart
          ((ServiceConnection) postman).onServiceConnected(componentName, binder);
          // Should attempt to stop service
          Intent intent = application.getNextStoppedService();
          Assert.assertNotNull(intent);
          Assert.assertEquals(new ComponentName(application.getApplicationContext(), ActorService.class),
                  intent.getComponent());
          // And start it again
          intent = application.getNextStartedService();
          Assert.assertNotNull(intent);
          Assert.assertEquals(new ComponentName(application.getApplicationContext(), ActorService.class),
                  intent.getComponent());
  
          // Second call should just stop service
          application.clearStartedServices();
          ((ServiceConnection) postman).onServiceConnected(componentName, binder);
          // Should attempt to stop service
          intent = application.getNextStoppedService();
          Assert.assertNotNull(intent);
          Assert.assertEquals(new ComponentName(application.getApplicationContext(), ActorService.class),
                  intent.getComponent());
  
          intent = application.getNextStartedService();
          Assert.assertNull(intent);
      }
test_case.class_method_signature: ServiceActorThreadTest.emptyRemoteExceptionTest()
test_case.full_signature: @Test public void emptyRemoteExceptionTest()
test_case.identifier: emptyRemoteExceptionTest
test_case.invocations: getInstance getApplicationContext mock getInterfaceDescriptor when doThrow getApplicationContext bind assertSame tell forClass newProxy verify any capture getValue assertNotNull onServiceConnected getNextStoppedService assertNotNull assertEquals getApplicationContext getComponent getNextStartedService assertNotNull assertEquals getApplicationContext getComponent clearStartedServices onServiceConnected getNextStoppedService assertNotNull assertEquals getApplicationContext getComponent getNextStartedService assertNull
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void emptyRemoteExceptionTest()
focal_class.declarator: sSenders = new SparseArray<>()
focal_class.modifier: private static final
focal_class.original_string: private static final SparseArray<WeakReference<ServiceConnection>> sSenders = new SparseArray<>();
focal_class.type: SparseArray<WeakReference<ServiceConnection>>
focal_class.var_name: sSenders
focal_class.declarator: mJobId
focal_class.modifier: private final
focal_class.original_string: private final int mJobId;
focal_class.type: int
focal_class.var_name: mJobId
focal_class.declarator: mContext
focal_class.modifier: @NonNull
      private final
focal_class.original_string: @NonNull
      private final Context mContext;
focal_class.type: Context
focal_class.var_name: mContext
focal_class.declarator: mProxyFactory
focal_class.modifier: @NonNull
      private final
focal_class.original_string: @NonNull
      private final ProxyFactory mProxyFactory;
focal_class.type: ProxyFactory
focal_class.var_name: mProxyFactory
focal_class.declarator: mFailureHandler
focal_class.modifier: @NonNull
      private final
focal_class.original_string: @NonNull
      private final FailureHandler mFailureHandler;
focal_class.type: FailureHandler
focal_class.var_name: mFailureHandler
focal_class.declarator: mService
focal_class.modifier: @NonNull
      private final
focal_class.original_string: @NonNull
      private final Class<? extends ActorService> mService;
focal_class.type: Class<? extends ActorService>
focal_class.var_name: mService
focal_class.file: actors-library/src/main/java/com/truecaller/androidactors/ServiceActorThread.java
focal_class.identifier: ServiceActorThread
focal_class.interfaces: implements ActorThread
focal_class.class_method_signature: ServiceActorThread.ServiceActorThread(@NonNull Context context, @NonNull ProxyFactory proxyFactory,
                                       @NonNull FailureHandler failureHandler, @NonNull Class<? extends ActorService> service,
                                       int jobId)
focal_class.full_signature:   ServiceActorThread(@NonNull Context context, @NonNull ProxyFactory proxyFactory,
                                       @NonNull FailureHandler failureHandler, @NonNull Class<? extends ActorService> service,
                                       int jobId)
focal_class.identifier: ServiceActorThread
focal_class.parameters: (@NonNull Context context, @NonNull ProxyFactory proxyFactory,
                                       @NonNull FailureHandler failureHandler, @NonNull Class<? extends ActorService> service,
                                       int jobId)
focal_class.signature:  ServiceActorThread(@NonNull Context context, @NonNull ProxyFactory proxyFactory,
                                       @NonNull FailureHandler failureHandler, @NonNull Class<? extends ActorService> service,
                                       int jobId)
focal_class.class_method_signature: ServiceActorThread.bind(@NonNull Class<T> cls, @NonNull T impl)
focal_class.full_signature: @NonNull @Override public ActorRef<T> bind(@NonNull Class<T> cls, @NonNull T impl)
focal_class.identifier: bind
focal_class.modifiers: @NonNull @Override public
focal_class.parameters: (@NonNull Class<T> cls, @NonNull T impl)
focal_class.return: ActorRef<T>
focal_class.signature: ActorRef<T> bind(@NonNull Class<T> cls, @NonNull T impl)
focal_class.class_method_signature: ServiceActorThread.getConnectionForJob(int jobId)
focal_class.full_signature: @Nullable /* package */ static ServiceConnection getConnectionForJob(int jobId)
focal_class.identifier: getConnectionForJob
focal_class.modifiers: @Nullable /* package */ static
focal_class.parameters: (int jobId)
focal_class.return: ServiceConnection
focal_class.signature: ServiceConnection getConnectionForJob(int jobId)
focal_method.body: @NonNull
      @Override
      public <T> ActorRef<T> bind(@NonNull Class<T> cls, @NonNull T impl) {
          ServiceMessageSenderProxy<T> postman = new ServiceMessageSenderProxy<>(mContext, mFailureHandler, mService, mJobId, impl);
          T instance = mProxyFactory.newProxy(cls, postman);
          return new ActorRefImpl<>(instance);
      }
focal_method.class_method_signature: ServiceActorThread.bind(@NonNull Class<T> cls, @NonNull T impl)
focal_method.full_signature: @NonNull @Override public ActorRef<T> bind(@NonNull Class<T> cls, @NonNull T impl)
focal_method.identifier: bind
focal_method.invocations: newProxy
focal_method.modifiers: @NonNull @Override public
focal_method.parameters: (@NonNull Class<T> cls, @NonNull T impl)
focal_method.return: ActorRef<T>
focal_method.signature: ActorRef<T> bind(@NonNull Class<T> cls, @NonNull T impl)