code: private static int[] ensureSize(int[] tab, int length) {
          if (tab.length < length) {
              tab = null;
              tab = new int[length];
          }
  
          return tab;
      }
docs: Ensure array is large enough or reallocate (no copying).