@Test @SmallTest public void bind_alreadyBound_throwsIllegalStateException() { mBufferedServiceConnection.bindService(); try { mBufferedServiceConnection.bindService(); fail(); } catch (IllegalStateException expected) { } }
void bindService() { if (mHasBound) { throw new IllegalStateException( "Each BufferedServiceConnection can only be bound once."); } mHasBound = true; mContext.bindService(mBindIntent, mConnection, mFlags); }
BufferedServiceConnection { void bindService() { if (mHasBound) { throw new IllegalStateException( "Each BufferedServiceConnection can only be bound once."); } mHasBound = true; mContext.bindService(mBindIntent, mConnection, mFlags); } }
BufferedServiceConnection { void bindService() { if (mHasBound) { throw new IllegalStateException( "Each BufferedServiceConnection can only be bound once."); } mHasBound = true; mContext.bindService(mBindIntent, mConnection, mFlags); } BufferedServiceConnection(
            Executor executor, Context context, Intent bindIntent, int flags); }
BufferedServiceConnection { void bindService() { if (mHasBound) { throw new IllegalStateException( "Each BufferedServiceConnection can only be bound once."); } mHasBound = true; mContext.bindService(mBindIntent, mConnection, mFlags); } BufferedServiceConnection(
            Executor executor, Context context, Intent bindIntent, int flags);  }
BufferedServiceConnection { void bindService() { if (mHasBound) { throw new IllegalStateException( "Each BufferedServiceConnection can only be bound once."); } mHasBound = true; mContext.bindService(mBindIntent, mConnection, mFlags); } BufferedServiceConnection(
            Executor executor, Context context, Intent bindIntent, int flags);   }