code: private static void collapseIfPossible(FastAdapter fastAdapter) {
          try {
              Class c = Class.forName("com.mikepenz.fastadapter.expandable.ExpandableExtension");
              if (c != null) {
                  IAdapterExtension extension = fastAdapter.getExtension(c);
                  if (extension != null) {
                      Method method = extension.getClass().getMethod("collapse");
                      method.invoke(extension);
                  }
              }
          } catch (Exception ignored) {
              //
          }
      }
docs: Uses Reflection to collapse all items if this adapter uses expandable items
  
  @param fastAdapter