code: def _testResizeImpl(self):
      d = self.buildCollection(10)
  
      # Fill the array.
      self.assertEqual(len(d), 0)
      for i in xrange(20):
          d.append(i)
      self.assertEqual(d[0], 10)
      self.assertEqual(d[9], 19)
      self.assertEqual(d[-1], 19)
      self.assertEqual(len(d), 10)
  
      # Shrink the array.
      d.resize(5)
      self.assertEqual(len(d), 5)
      self.assertEqual(d[0], 15)
      self.assertEqual(d[4], 19)
      self.assertEqual(d[-1], 19)
  
      # Grow the array.
      d.resize(10)
      self.assertEqual(len(d), 5)
      self.assertEqual(d[0], 15)
      self.assertEqual(d[4], 19)
      self.assertEqual(d[-1], 19)
  
      # Add one element.
      d.append(20)
      self.assertEqual(len(d), 6)
      self.assertEqual(d[0], 15)
      self.assertEqual(d[1], 16)
      self.assertEqual(d[2], 17)
      self.assertEqual(d[3], 18)
      self.assertEqual(d[4], 19)
      self.assertEqual(d[5], 20)
      self.assertEqual(d[-1], 20)
  
      # No resize
      d.resize(10)
      self.assertEqual(d[0], 15)
      self.assertEqual(d[5], 20)
      self.assertEqual(d[-1], 20)
  
      # Shrink it back.
      d.resize(4)
      self.assertEqual(len(d), 4)
      self.assertEqual(d[0], 17)
      self.assertEqual(d[3], 20)
      self.assertEqual(d[-1], 20)
  
imports: import datetime
  from six.moves import xrange
  from .None import common
  from pyalgotrade import utils
  from pyalgotrade.utils import collections
  from pyalgotrade.utils import dt
label_desc: Use image node_id 3 for calling the CollectionTestCaseBase obj's underlying member method code with example usage: obj._testResizeImpl() without return types