private void throwIfNotLinearLayoutManager(RecyclerView.LayoutManager layoutManager){
    if (!(layoutManager instanceof LinearLayoutManager)) {
      throw new IllegalStateException("StickyListHeadersDecoration can only be used with a " +
          "LinearLayoutManager.");
    }
  }
OrientationProvider for ReyclerViews who use a LinearLayoutManager
library/src/main/java/com/timehop/stickyheadersrecyclerview/util/LinearLayoutOrientationProvider.java