test_class.declarator: rule = MockitoJUnit.rule()
test_class.modifier: @Rule
      public
test_class.original_string: @Rule
      public MockitoRule rule = MockitoJUnit.rule();
test_class.type: MockitoRule
test_class.var_name: rule
test_class.declarator: referenceManager
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ReferenceManager referenceManager;
test_class.type: ReferenceManager
test_class.var_name: referenceManager
test_class.declarator: audioHelper
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private AudioHelper audioHelper;
test_class.type: AudioHelper
test_class.var_name: audioHelper
test_class.declarator: analytics
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private Analytics analytics;
test_class.type: Analytics
test_class.var_name: analytics
test_class.file: collect_app/src/test/java/org/odk/collect/android/widgets/GridMultiWidgetTest.java
test_class.identifier: GridMultiWidgetTest
test_class.superclass: extends GeneralSelectMultiWidgetTest<GridMultiWidget>
test_case.body: @Test
      public void whenChoicesHaveAudio_andNoButtonsMode_clickingChoice_playsAndStopsAudio() throws Exception {
          createMockReference(referenceManager, "file://blah2.mp3");
          String reference = createMockReference(referenceManager, "file://blah1.mp3");
  
          formEntryPrompt = new MockFormEntryPromptBuilder()
                  .withIndex("i am index")
                  .withAppearance(NO_BUTTONS)
                  .withSelectChoices(asList(
                          new SelectChoice("1", "1"),
                          new SelectChoice("2", "2")
                  ))
                  .withSpecialFormSelectChoiceText(asList(
                          new Pair<>(FormEntryCaption.TEXT_FORM_AUDIO, "file://blah1.mp3"),
                          new Pair<>(FormEntryCaption.TEXT_FORM_AUDIO, "file://blah2.mp3")
                  ))
                  .build();
  
          GridMultiWidget widget = getActualWidget();
  
          widget.onItemClick(0);
          verify(audioHelper).play(new Clip("i am index 0", reference));
  
          widget.onItemClick(0);
          verify(audioHelper).stop();
      }
test_case.class_method_signature: GridMultiWidgetTest.whenChoicesHaveAudio_andNoButtonsMode_clickingChoice_playsAndStopsAudio()
test_case.full_signature: @Test public void whenChoicesHaveAudio_andNoButtonsMode_clickingChoice_playsAndStopsAudio()
test_case.identifier: whenChoicesHaveAudio_andNoButtonsMode_clickingChoice_playsAndStopsAudio
test_case.invocations: createMockReference createMockReference build withSpecialFormSelectChoiceText withSelectChoices withAppearance withIndex asList asList getActualWidget onItemClick play verify onItemClick stop verify
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void whenChoicesHaveAudio_andNoButtonsMode_clickingChoice_playsAndStopsAudio()
focal_class.file: collect_app/src/main/java/org/odk/collect/android/widgets/GridMultiWidget.java
focal_class.identifier: GridMultiWidget
focal_class.class_method_signature: GridMultiWidget.GridMultiWidget(Context context, QuestionDetails questionDetails)
focal_class.full_signature: public  GridMultiWidget(Context context, QuestionDetails questionDetails)
focal_class.identifier: GridMultiWidget
focal_class.modifiers: public
focal_class.parameters: (Context context, QuestionDetails questionDetails)
focal_class.signature:  GridMultiWidget(Context context, QuestionDetails questionDetails)
focal_class.class_method_signature: GridMultiWidget.fillInAnswer()
focal_class.full_signature: @Override protected void fillInAnswer()
focal_class.identifier: fillInAnswer
focal_class.modifiers: @Override protected
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void fillInAnswer()
focal_class.class_method_signature: GridMultiWidget.onItemClick(int index)
focal_class.full_signature: @Override protected void onItemClick(int index)
focal_class.identifier: onItemClick
focal_class.modifiers: @Override protected
focal_class.parameters: (int index)
focal_class.return: void
focal_class.signature: void onItemClick(int index)
focal_class.class_method_signature: GridMultiWidget.getAnswer()
focal_class.full_signature: @Override public IAnswerData getAnswer()
focal_class.identifier: getAnswer
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: IAnswerData
focal_class.signature: IAnswerData getAnswer()
focal_class.class_method_signature: GridMultiWidget.setChoiceSelected(int choiceIndex, boolean isSelected)
focal_class.full_signature: @Override public void setChoiceSelected(int choiceIndex, boolean isSelected)
focal_class.identifier: setChoiceSelected
focal_class.modifiers: @Override public
focal_class.parameters: (int choiceIndex, boolean isSelected)
focal_class.return: void
focal_class.signature: void setChoiceSelected(int choiceIndex, boolean isSelected)
focal_class.superclass: extends BaseGridWidget
focal_method.body: @Override
      protected void onItemClick(int index) {
          if (selectedItems.contains(index)) {
              selectedItems.remove(Integer.valueOf(index));
              if (noButtonsMode) {
                  itemViews[index].setBackgroundColor(0);
                  getAudioHelper().stop();
              }
          } else {
              selectedItems.add(index);
              if (noButtonsMode) {
                  itemViews[index].setBackgroundColor(bgOrange);
  
                  SelectChoice item = items.get(index);
                  Clip clip = getClip(getFormEntryPrompt(), item, getReferenceManager());
  
                  if (clip != null) {
                      getAudioHelper().play(clip);
                  }
              }
          }
          widgetValueChanged();
      }
focal_method.class_method_signature: GridMultiWidget.onItemClick(int index)
focal_method.full_signature: @Override protected void onItemClick(int index)
focal_method.identifier: onItemClick
focal_method.invocations: contains remove valueOf setBackgroundColor stop getAudioHelper add setBackgroundColor get getClip getFormEntryPrompt getReferenceManager play getAudioHelper widgetValueChanged
focal_method.modifiers: @Override protected
focal_method.parameters: (int index)
focal_method.return: void
focal_method.signature: void onItemClick(int index)