@Test public void shouldGroupProducts_usingOther_forProductThatDoesNotMatch_Tag() { BomViewHeader header = new BomViewHeaderBuilder("€", "fr") .withColumn("reference", "Reference", ColumnType.String) .withColumn("quantity", "Qty", ColumnType.Number) .withColumn("unitPrice", "Unit Price", ColumnType.Price) .withColumn("NET_PRICE", "Net Price", ColumnType.Price, true) .withGroup("switchboard") .build(); List<TaggedProduct> products = new TaggedProductBuilder() .withProduct("PRA15424", 2, 0.20, 45d, "PRA15424 Desc") .withTag("switchboard", "1") .withProduct("A9R60225", 4, 0.10, 25d, "A9R60225 Desc") .withProduct("A9R60226", 4, 0.10, 25d, "A9R60225 Desc") .build(); BomExportView bomExportView = new BomExportView(header, new BomModel("EUR", "en", products)); BomGroup group = bomExportView.group(); assertThat(group.getContent()).isNotEmpty().hasSize(2); Summable firstContent = group.getContent().get(1); assertThat(firstContent).isExactlyInstanceOf(BomGroup.class); assertThat(((BomGroup) firstContent).getValue()).isEqualTo(BomGroup.BOM_EXPORT_OTHERS); assertThat(((BomGroup) firstContent).getContent()).hasSize(2); }