boolean before, List linkList) {
if (fragment == null) {
return;
}
FormFragmentInstance instance = (FormFragmentInstance) fragment;
FormFragment formFragment = (FormFragment) instance.getFormat();
boolean isLink = prev ? formFragment.isPreviousLinkBefore() :
formFragment.isNextLinkBefore();
if ((before && isLink) || (!before && !isLink)) {
addLink(instance, formFragment, prev, linkList);
}
}