void expandCapacity(int minimumCapacity){
  int newCapacity=(value.length + 1) * 2;
  if (newCapacity < 0) {
    newCapacity=Integer.MAX_VALUE;
  }
 else   if (minimumCapacity > newCapacity) {
    newCapacity=minimumCapacity;
  }
  value=Arrays.copyOf(value,newCapacity);
}

void expandCapacity ( int minimumCapacity ) { int newCapacity = ( value . length + 1 ) * 2 ; if ( newCapacity < 0 ) { newCapacity = Integer . MAX_VALUE ; } else if ( minimumCapacity > newCapacity ) { newCapacity = minimumCapacity ; } value = Arrays . copyOf ( value , newCapacity ) ; }
this implements the expansion semantics of ensurecapacity with no size check or synchronization .
