### Question:
BasketItem { public float getTotalFractionalAmount() { if (!hasModifiers()) { return getTotalAmount(); } float amount = calculateFinalAmount(baseAmount, modifiers); return amount * quantity; } BasketItem();   BasketItem(String id, String label, String category, long amount, float baseAmount, int quantity,
               Measurement measurement, List<BasketItemModifier> modifiers, @Deprecated Map<String, String> references,
               AdditionalData itemData); @NonNull String getId(); @NonNull String getLabel(); @Nullable String getCategory(); long getIndividualAmount(); float getIndividualBaseAmount(); @JsonConverter.ExposeMethod(value = "totalAmount") long getTotalAmount(); float getTotalFractionalAmount(); @JsonConverter.ExposeMethod(value = "totalBaseAmount") float getTotalBaseAmount(); int getQuantity(); @JsonConverter.ExposeMethod(value = "hasMeasurement") boolean hasMeasurement(); @Nullable Measurement getMeasurement(); @JsonConverter.ExposeMethod(value = "hasModifiers") boolean hasModifiers(); @NonNull List<BasketItemModifier> getModifiers(); @JsonConverter.ExposeMethod(value = "hasItemData") boolean hasItemData(); @NonNull AdditionalData getItemData(); @Deprecated @JsonConverter.ExposeMethod(value = "hasReferences") boolean hasReferences(); @Nullable @Deprecated String getReference(String referenceKey); @NonNull @Deprecated Map<String, String> getReferences(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); static float calculateFinalAmount(float baseAmount, List<BasketItemModifier> modifiers);  }### Answer:
@Test public void checkGetTotalFractionalAmount() throws Exception { BasketItem basketItem = new BasketItemBuilder() .withLabel("ice") .withQuantity(2) .withBaseAmountAndModifiers(500, new BasketItemModifierBuilder("tax1", "tax").withFractionalAmount(202.05f).build(), new BasketItemModifierBuilder("tax2", "tax").withPercentage(24.56f).build(), new BasketItemModifierBuilder("tax3", "tax").withAmount(200).build(), new BasketItemModifierBuilder("tax4", "tax").withFractionalAmount(-5.5f).build(), new BasketItemModifierBuilder("tax5", "tax").withPercentage(-25.003f).build()).build(); float expected = 2 * (500 + 202.05f + (500 * 0.2456f) + 200 + (-5.5f) + (500 * -0.25003f)); assertThat(basketItem.getTotalFractionalAmount()).isEqualTo(expected); }