@VisibleForTesting
  static int getIdForInsertionRequest(EditorInfo info) {
    return info == null
        ? 0
        : Arrays.hashCode(new int[] {info.fieldId, info.packageName.hashCode()});
  }
@Test
  public void testDoesNotCommitIfInputFieldIsDifferent() {
    simulateFinishInputFlow();
    EditorInfo info = createEditorInfoTextWithSuggestionsForSetUp();
    EditorInfoCompat.setContentMimeTypes(info, new String[] {"image/gif"});
    simulateOnStartInputFlow(false, info);

    mAnySoftKeyboardUnderTest.simulateKeyPress(KeyCodes.IMAGE_MEDIA_POPUP);

    ArgumentCaptor<InsertionRequestCallback> argumentCaptor =
        ArgumentCaptor.forClass(InsertionRequestCallback.class);
    Mockito.verify(mRemoteInsertion)
        .startMediaRequest(Mockito.any(), Mockito.anyInt(), argumentCaptor.capture());

    argumentCaptor
        .getValue()
        .onMediaRequestDone(
            1 + AnySoftKeyboardMediaInsertion.getIdForInsertionRequest(info),
            new InputContentInfoCompat(
                Uri.EMPTY,
                new ClipDescription("", EditorInfoCompat.getContentMimeTypes(info)),
                null));

    Assert.assertNull(mAnySoftKeyboardUnderTest.getCommitedInputContentInfo());
  }