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

    Mockito.verify(mRemoteInsertion, Mockito.never())
        .startMediaRequest(Mockito.any(), Mockito.anyInt(), Mockito.any());

    mAnySoftKeyboardUnderTest.simulateKeyPress(KeyCodes.IMAGE_MEDIA_POPUP);

    Mockito.verify(mRemoteInsertion)
        .startMediaRequest(
            Mockito.eq(new String[] {"image/gif"}),
            Mockito.eq(AnySoftKeyboardMediaInsertion.getIdForInsertionRequest(info)),
            Mockito.any());
  }