public int consume(){
  int consumedAmount;
  if (Math.abs(left) < Math.abs(getRegen())) {
    consumedAmount=left;
    left=0;
  }
 else {
    consumedAmount=getRegen();
    left-=getRegen();
  }
  return consumedAmount;
}

public int consume ( ) { int consumedAmount ; if ( Math . abs ( left ) < Math . abs ( getRegen ( ) ) ) { consumedAmount = left ; left = 0 ; } else { consumedAmount = getRegen ( ) ; left -= getRegen ( ) ; } return consumedAmount ; }
consumes a part of this item .
