code: @SuppressWarnings({"WeakerAccess", "unused"}) // For library users
      public void registerWidget(View widget) {
          prepareWidget(widget);
  
          if (widget instanceof AlgoliaResultsListener) {
              AlgoliaResultsListener listener = (AlgoliaResultsListener) widget;
              if (!this.resultListeners.contains(listener)) {
                  this.resultListeners.add(listener);
              }
              searcher.registerResultListener(listener);
          }
          if (widget instanceof AlgoliaErrorListener) {
              AlgoliaErrorListener listener = (AlgoliaErrorListener) widget;
              if (!this.errorListeners.contains(listener)) {
                  this.errorListeners.add(listener);
              }
              searcher.registerErrorListener(listener);
          }
          if (widget instanceof AlgoliaSearcherListener) {
              AlgoliaSearcherListener listener = (AlgoliaSearcherListener) widget;
              listener.initWithSearcher(searcher);
          }
      }
docs: Links the given widget to InstantSearch according to the interfaces it implements.
  
  @param widget a widget implementing ({@link AlgoliaResultsListener} || {@link AlgoliaErrorListener} || {@link AlgoliaSearcherListener}).