#NEWLINE# def _testResizeImpl( self ) : #NEWLINE# #INDENT# d = self . buildCollection ( 10 ) #NEWLINE# self . assertEqual ( len ( d ) , 0 ) #NEWLINE# for i in range ( 20 ) : #NEWLINE# #INDENT# d . append ( i ) #NEWLINE# #UNINDENT# self . assertEqual ( d [ 0 ] , 10 ) #NEWLINE# self . assertEqual ( d [ 9 ] , 19 ) #NEWLINE# self . assertEqual ( d [ ( - 1 ) ] , 19 ) #NEWLINE# self . assertEqual ( len ( d ) , 10 ) #NEWLINE# d . resize ( 5 ) #NEWLINE# self . assertEqual ( len ( d ) , 5 ) #NEWLINE# self . assertEqual ( d [ 0 ] , 15 ) #NEWLINE# self . assertEqual ( d [ 4 ] , 19 ) #NEWLINE# self . assertEqual ( d [ ( - 1 ) ] , 19 ) #NEWLINE# d . resize ( 10 ) #NEWLINE# self . assertEqual ( len ( d ) , 5 ) #NEWLINE# self . assertEqual ( d [ 0 ] , 15 ) #NEWLINE# self . assertEqual ( d [ 4 ] , 19 ) #NEWLINE# self . assertEqual ( d [ ( - 1 ) ] , 19 ) #NEWLINE# d . append ( 20 ) #NEWLINE# self . assertEqual ( len ( d ) , 6 ) #NEWLINE# self . assertEqual ( d [ 0 ] , 15 ) #NEWLINE# self . assertEqual ( d [ 1 ] , 16 ) #NEWLINE# self . assertEqual ( d [ 2 ] , 17 ) #NEWLINE# self . assertEqual ( d [ 3 ] , 18 ) #NEWLINE# self . assertEqual ( d [ 4 ] , 19 ) #NEWLINE# self . assertEqual ( d [ 5 ] , 20 ) #NEWLINE# self . assertEqual ( d [ ( - 1 ) ] , 20 ) #NEWLINE# d . resize ( 10 ) #NEWLINE# self . assertEqual ( d [ 0 ] , 15 ) #NEWLINE# self . assertEqual ( d [ 5 ] , 20 ) #NEWLINE# self . assertEqual ( d [ ( - 1 ) ] , 20 ) #NEWLINE# d . resize ( 4 ) #NEWLINE# self . assertEqual ( len ( d ) , 4 ) #NEWLINE# self . assertEqual ( d [ 0 ] , 17 ) #NEWLINE# self . assertEqual ( d [ 3 ] , 20 ) #NEWLINE# self . assertEqual ( d [ ( - 1 ) ] , 20 )