private static boolean isAlignmentNeeded(JComponent view, boolean horizontal) {
    return (!SystemInfo.isMac || horizontal && ScrollSettings.isHorizontalGapNeededOnMac.invoke()) &&
           (view instanceof JList || view instanceof JTree || (!SystemInfo.isMac && ScrollSettings.isGapNeededForAnyComponent.invoke()));
  }
private static boolean isAlignmentNeeded(JComponent view, boolean horizontal)