JobServiceConnection implements ServiceConnection { @Override public synchronized void onServiceDisconnected(ComponentName name) { unbind(); } JobServiceConnection(IJobCallback callback, Context context); @Override synchronized void onServiceConnected(ComponentName name, IBinder service); @Override synchronized void onServiceDisconnected(ComponentName name);  }
@Test public void onServiceDisconnected() throws Exception { connection.onServiceConnected(null, binderMock); binderMock.verifyStartArguments(jobData, noopCallback); assertFalse(connection.wasUnbound()); connection.onServiceDisconnected(null); assertTrue(connection.wasUnbound()); }