for (int i = counter; i < paymentTransactionDetails.getPaymentItemInfo().getPaymentItem().length; i++) {
lines.add(i, paymentTransactionDetails.getPaymentItemInfo().getPaymentItem(i));
counter++;
}
for (int i = counter; i < _num; i++) {
lines.add(i, new PaymentItemType());
}
}
else {
lines.add(new PaymentItemType());
}
paymentTransactionDetails.getPaymentItemInfo().setPaymentItem((PaymentItemType[]) lines.toArray(new PaymentItemType[lines.size()]));
}