### Question:
BillSecurity implements LegalEntitySecurity, ImmutableBean, Serializable { public static BillSecurity.Builder builder() { return new BillSecurity.Builder(); } private  BillSecurity(
      SecurityInfo info,
      AdjustablePayment notional,
      DayCount dayCount,
      BillYieldConvention yieldConvention,
      LegalEntityId legalEntityId,
      DaysAdjustment settlementDateOffset); @Override Currency getCurrency(); @Override ImmutableSet<SecurityId> getUnderlyingIds(); @Override BillSecurity withInfo(SecurityInfo info); @Override Bill createProduct(ReferenceData refData); @Override BillTrade createTrade(TradeInfo info, double quantity, double tradePrice, ReferenceData refData); @Override BillPosition createPosition(PositionInfo positionInfo, double quantity, ReferenceData refData); @Override BillPosition createPosition(
      PositionInfo positionInfo,
      double longQuantity,
      double shortQuantity,
      ReferenceData refData); static BillSecurity.Meta meta(); static BillSecurity.Builder builder(); @Override BillSecurity.Meta metaBean(); @Override SecurityInfo getInfo(); AdjustablePayment getNotional(); DayCount getDayCount(); BillYieldConvention getYieldConvention(); @Override LegalEntityId getLegalEntityId(); DaysAdjustment getSettlementDateOffset(); Builder toBuilder(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void test_builder_fail() { assertThatIllegalArgumentException() .isThrownBy(() -> BillSecurity.builder() .dayCount(DAY_COUNT) .info(INFO) .legalEntityId(LEGAL_ENTITY) .notional(NOTIONAL) .settlementDateOffset(DaysAdjustment.ofBusinessDays(-1, USNY, BUSINESS_ADJUST)) .yieldConvention(YIELD_CONVENTION) .build()); assertThatIllegalArgumentException() .isThrownBy(() -> BillSecurity.builder() .dayCount(DAY_COUNT) .info(INFO) .legalEntityId(LEGAL_ENTITY) .notional(AdjustablePayment.of(CurrencyAmount.of(CCY, -2_000_000), MATURITY_DATE_ADJ)) .settlementDateOffset(SETTLE) .yieldConvention(YIELD_CONVENTION) .build()); }
@Test public void coverage() { BillSecurity test1 = BillSecurity.builder() .dayCount(DAY_COUNT) .info(INFO) .legalEntityId(LEGAL_ENTITY) .notional(NOTIONAL) .settlementDateOffset(SETTLE) .yieldConvention(YIELD_CONVENTION) .build(); coverImmutableBean(test1); BillSecurity test2 = BillSecurity.builder() .dayCount(DayCounts.ACT_365F) .info(SecurityInfo.of(SecurityId.of("OG-Test", "ID2"), PRICE_INFO)) .legalEntityId(LegalEntityId.of("OG-Ticker", "LE2")) .notional(AdjustablePayment.of(CurrencyAmount.of(CCY, 10), MATURITY_DATE_ADJ)) .settlementDateOffset(DaysAdjustment.ofBusinessDays(2, EUTA, BUSINESS_ADJUST)) .yieldConvention(BillYieldConvention.INTEREST_AT_MATURITY) .build(); coverBeanEquals(test1, test2); }
@Test public void test_serialization() { BillSecurity test = BillSecurity.builder() .dayCount(DAY_COUNT) .info(INFO) .legalEntityId(LEGAL_ENTITY) .notional(NOTIONAL) .settlementDateOffset(SETTLE) .yieldConvention(YIELD_CONVENTION) .build(); assertSerialization(test); }