Source:
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { if (getHelperItem(position) instanceof ParentWrapper) { PVH parentViewHolder = (PVH) holder; if (mParentAndIconClickable) { if (mCustomParentAnimationViewId != CUSTOM_ANIMATION_VIEW_NOT_SET && mAnimationDuration != CUSTOM_ANIMATION_DURATION_NOT_SET) { parentViewHolder.setCustomClickableViewAndItem(mCustomParentAnimationViewId); parentViewHolder.setAnimationDuration(mAnimationDuration); } else if (mCustomParentAnimationViewId != CUSTOM_ANIMATION_VIEW_NOT_SET) { parentViewHolder.setCustomClickableViewAndItem(mCustomParentAnimationViewId); parentViewHolder.cancelAnimation(); } else { parentViewHolder.setMainItemClickToExpand(); } } else { if (mCustomParentAnimationViewId != CUSTOM_ANIMATION_VIEW_NOT_SET && mAnimationDuration != CUSTOM_ANIMATION_DURATION_NOT_SET) { parentViewHolder.setCustomClickableViewOnly(mCustomParentAnimationViewId); parentViewHolder.setAnimationDuration(mAnimationDuration); } else if (mCustomParentAnimationViewId != CUSTOM_ANIMATION_VIEW_NOT_SET) { parentViewHolder.setCustomClickableViewOnly(mCustomParentAnimationViewId); parentViewHolder.cancelAnimation(); } else { parentViewHolder.setMainItemClickToExpand(); } } parentViewHolder.setExpanded(((ParentWrapper) getHelperItem(position)).isExpanded()); onBindParentViewHolder(parentViewHolder, position, ((ParentWrapper) getHelperItem(position)).getParentObject()); } else if (getHelperItem(position) == null) { throw new IllegalStateException("Incorrect ViewHolder found"); } else { onBindChildViewHolder((CVH) holder, position, getHelperItem(position)); } }

Target:
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { Object helperItem = getHelperItem(position); if (helperItem instanceof ParentWrapper) { PVH parentViewHolder = (PVH) holder; if (mParentAndIconClickable) { if (mCustomParentAnimationViewId != CUSTOM_ANIMATION_VIEW_NOT_SET && mAnimationDuration != CUSTOM_ANIMATION_DURATION_NOT_SET) { parentViewHolder.setCustomClickableViewAndItem(mCustomParentAnimationViewId); parentViewHolder.setAnimationDuration(mAnimationDuration); } else if (mCustomParentAnimationViewId != CUSTOM_ANIMATION_VIEW_NOT_SET) { parentViewHolder.setCustomClickableViewAndItem(mCustomParentAnimationViewId); parentViewHolder.cancelAnimation(); } else { parentViewHolder.setMainItemClickToExpand(); } } else { if (mCustomParentAnimationViewId != CUSTOM_ANIMATION_VIEW_NOT_SET && mAnimationDuration != CUSTOM_ANIMATION_DURATION_NOT_SET) { parentViewHolder.setCustomClickableViewOnly(mCustomParentAnimationViewId); parentViewHolder.setAnimationDuration(mAnimationDuration); } else if (mCustomParentAnimationViewId != CUSTOM_ANIMATION_VIEW_NOT_SET) { parentViewHolder.setCustomClickableViewOnly(mCustomParentAnimationViewId); parentViewHolder.cancelAnimation(); } else { parentViewHolder.setMainItemClickToExpand(); } } ParentWrapper parentWrapper = (ParentWrapper) helperItem; parentViewHolder.setExpanded(parentWrapper.isExpanded()); onBindParentViewHolder(parentViewHolder, position, parentWrapper.getParentObject()); } else if (helperItem == null) { throw new IllegalStateException("Incorrect ViewHolder found"); } else { onBindChildViewHolder((CVH) holder, position, helperItem); } }