Source:
<code>private void addPoItemsToProperties(Properties poProperties, List poItems) { List<Properties> poLines = new ArrayList<>(); for (Object obj : poItems) { if (obj instanceof PurchaseOrderItem) { PurchaseOrderItem poItem = (PurchaseOrderItem)obj; Properties lineProps = new Properties(); <START> safelyAddProperty(lineProps, CUPurapConstants.AMOUNT.toLowerCase(), poItem.getTotalAmount()); <END> safelyAddProperty(lineProps, CUPurapConstants.Einvoice.INVOICED_AMOUNT.toLowerCase(), poItem.getItemInvoicedTotalAmount()); safelyAddProperty(lineProps, CUPurapConstants.Einvoice.PO_QUANTITY, poItem.getItemQuantity()); safelyAddProperty(lineProps, CUPurapConstants.Einvoice.INVOICE_QUANTITY, poItem.getItemInvoicedTotalQuantity()); safelyAddProperty(lineProps, CUPurapConstants.Einvoice.UNIT_OF_MEASURE, poItem.getItemUnitOfMeasureCode()); safelyAddProperty(lineProps, CUPurapConstants.Einvoice.DESCRIPTION, poItem.getItemDescription()); safelyAddProperty(lineProps, CUPurapConstants.Einvoice.UNIT_PRICE, poItem.getItemUnitPrice()); safelyAddProperty(lineProps, CUPurapConstants.Einvoice.LINE_NUMBER, poItem.getItemLineNumber()); safelyAddProperty(lineProps, CUPurapConstants.Einvoice.PART_NUMBER, poItem.getItemAuxiliaryPartIdentifier()); safelyAddProperty(lineProps, CUPurapConstants.Einvoice.ITEM_TYPE_DESCRIPTION, poItem.getItemType()); safelyAddProperty(lineProps, CUPurapConstants.Einvoice.ITEM_TYPE_CODE, poItem.getItemTypeCode()); safelyAddProperty(lineProps, CUPurapConstants.Einvoice.PO_ITEM_ID, poItem.getItemIdentifier()); poLines.add(lineProps); } } poProperties.put(CUPurapConstants.Einvoice.ITEMS, poLines.toArray()); }</code><technical_language>I suggest adding a new CUPurapConstants.Einvoice.AMOUNT constant a lowercase value, a more consistent convention for tracking Properties keys</technical_language>

Target:
private void addPoItemsToProperties(Properties poProperties, List poItems) { List<Properties> poLines = new ArrayList<>(); for (Object obj : poItems) { if (obj instanceof PurchaseOrderItem) { PurchaseOrderItem poItem = (PurchaseOrderItem)obj; Properties lineProps = new Properties(); safelyAddProperty(lineProps, CUPurapConstants.Einvoice.AMOUNT, poItem.getTotalAmount()); safelyAddProperty(lineProps, CUPurapConstants.Einvoice.INVOICED_AMOUNT, poItem.getItemInvoicedTotalAmount()); safelyAddProperty(lineProps, CUPurapConstants.Einvoice.PO_QUANTITY, poItem.getItemQuantity()); safelyAddProperty(lineProps, CUPurapConstants.Einvoice.INVOICE_QUANTITY, poItem.getItemInvoicedTotalQuantity()); safelyAddProperty(lineProps, CUPurapConstants.Einvoice.UNIT_OF_MEASURE, poItem.getItemUnitOfMeasureCode()); safelyAddProperty(lineProps, CUPurapConstants.Einvoice.DESCRIPTION, poItem.getItemDescription()); safelyAddProperty(lineProps, CUPurapConstants.Einvoice.UNIT_PRICE, poItem.getItemUnitPrice()); safelyAddProperty(lineProps, CUPurapConstants.Einvoice.LINE_NUMBER, poItem.getItemLineNumber()); safelyAddProperty(lineProps, CUPurapConstants.Einvoice.PART_NUMBER, poItem.getItemAuxiliaryPartIdentifier()); safelyAddProperty(lineProps, CUPurapConstants.Einvoice.ITEM_TYPE_DESCRIPTION, poItem.getItemType()); safelyAddProperty(lineProps, CUPurapConstants.Einvoice.ITEM_TYPE_CODE, poItem.getItemTypeCode()); safelyAddProperty(lineProps, CUPurapConstants.Einvoice.PO_ITEM_ID, poItem.getItemIdentifier()); poLines.add(lineProps); } } poProperties.put(CUPurapConstants.Einvoice.ITEMS, poLines.toArray()); }