### Question:
Invoice extends UdoDomainObject2<T> implements WithApplicationTenancyAny, WithApplicationTenancyPathPersisted { @Property(notPersisted = true) public BigDecimal getTotalNetAmount() { return sum(InvoiceItem::getNetAmount); } Invoice(final String keyProperties); @Property(hidden = Where.ALL_TABLES) @PropertyLayout( named = "Application Level", describedAs = "Determines those users for whom this object is available to view and/or modify." ) ApplicationTenancy getApplicationTenancy(); String title(); @Property(hidden = Where.OBJECT_FORMS) String getNumber(); @Action( semantics = SemanticsOf.IDEMPOTENT, restrictTo = RestrictTo.PROTOTYPING ) Invoice updateAttribute(
            final InvoiceAttributeName name,
            @Parameter(maxLength = NotesType.Meta.MAX_LEN)
            @ParameterLayout(multiLine = Invoice.DescriptionType.Meta.MULTI_LINE) final String value,
            InvoiceAttributeAction action
    ); @Action(semantics = SemanticsOf.IDEMPOTENT) Invoice changeDueDate(final LocalDate dueDate); LocalDate default0ChangeDueDate(final LocalDate dueDate); String disableChangeDueDate(); @Action(semantics = SemanticsOf.IDEMPOTENT) Invoice changePaymentMethod(final PaymentMethod paymentMethod); PaymentMethod default0ChangePaymentMethod(); String disableChangePaymentMethod(); String validateChangePaymentMethod(final PaymentMethod paymentMethod); @Programmatic BigInteger nextItemSequence(); @Property(notPersisted = true) BigDecimal getTotalNetAmount(); @Property(notPersisted = true, hidden = Where.ALL_TABLES) BigDecimal getTotalVatAmount(); @Property(notPersisted = true) BigDecimal getTotalGrossAmount(); @Programmatic boolean isImmutableDueToState(); @Programmatic InvoiceItem findFirstItemWithCharge(final Charge charge); Invoice verify(); boolean hideVerify();  }### Answer:
@Test public void netAmount() throws Exception { InvoiceForTesting invoiceForTesting = new InvoiceForTesting(); InvoiceItemForTesting item1 = new InvoiceItemForTesting(invoiceForTesting); item1.setNetAmount(new BigDecimal("123.45")); InvoiceItemForTesting item2 = new InvoiceItemForTesting(invoiceForTesting); item2.setNetAmount(new BigDecimal("543.21")); invoiceForTesting.getItems().add(item1); invoiceForTesting.getItems().add(item2); assertThat(invoiceForTesting.getItems()).hasSize(2); BigDecimal netAmount = invoiceForTesting.getTotalNetAmount(); assertThat(netAmount).isEqualTo(new BigDecimal("666.66")); }