if (startingType == null) {
throw new IllegalArgumentException("Starting type must not be null");
}
this.startingType = startingType;
currentTrade = new Trade(startingType);
<BUG>}
public Trade getCurrentTrade() {</BUG>
return currentTrade;
<BUG>}
public void operate(int index, Decimal price, Decimal amount) {
</BUG>
currentTrade.operate(index);

if (startingType == null) {
throw new IllegalArgumentException("Starting type must not be null");
}
this.startingType = startingType;
currentTrade = new Trade(startingType);
}
public TradingRecord(Operation... operations) {
this(operations[0].getType());
for (int i = 0; i < operations.length - 1; i += 2) {
Operation o1 = operations[i];
Operation o2 = i+1 < operations.length ? operations[i+1] : null;
currentTrade = new Trade(o1, o2);
