HullWhiteOneFactorVolatilityTable implements ImmutableBean { public static HullWhiteOneFactorVolatilityTable.Builder builder() { return new HullWhiteOneFactorVolatilityTable.Builder(); } protected  HullWhiteOneFactorVolatilityTable(HullWhiteOneFactorVolatilityTable.Builder builder); static HullWhiteOneFactorVolatilityTable.Meta meta(); static HullWhiteOneFactorVolatilityTable.Builder builder(); @Override HullWhiteOneFactorVolatilityTable.Meta metaBean(); @Override Property<R> property(String propertyName); @Override Set<String> propertyNames(); SortedSet<HullWhiteOneFactorVolatilityEntry> getEntries(); Builder toBuilder(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }
@Test(expectedExceptions = NullPointerException.class) public void nullEntryIsNotValid() { SortedSet<HullWhiteOneFactorVolatilityEntry> entries = new TreeSet<>( new Comparator<HullWhiteOneFactorVolatilityEntry>() { @Override public int compare(HullWhiteOneFactorVolatilityEntry o1, HullWhiteOneFactorVolatilityEntry o2) { return 0; } }); entries.add(null); HullWhiteOneFactorVolatilityTable.builder() .entries(entries) .build(); }
@Test(expectedExceptions = IllegalArgumentException.class) public void singleEntryWithEndIsNotValid() { SortedSet<HullWhiteOneFactorVolatilityEntry> entries = ImmutableSortedSet.of( HullWhiteOneFactorVolatilityEntry.builder() .startTenor(Tenor.ofDays(0)) .endTenor(Tenor.ofDays(10)) .volatility(1.0) .build()); HullWhiteOneFactorVolatilityTable.builder() .entries(entries) .build(); }
@Test(expectedExceptions = IllegalArgumentException.class) public void tableWithOverlappingEntriesIsNotValid() { SortedSet<HullWhiteOneFactorVolatilityEntry> entries = ImmutableSortedSet.of( HullWhiteOneFactorVolatilityEntry.builder() .startTenor(Tenor.ofDays(0)) .endTenor(Tenor.ofDays(5)) .volatility(1.0) .build(), HullWhiteOneFactorVolatilityEntry.builder() .startTenor(Tenor.ofDays(3)) .endTenor(Tenor.ofDays(10)) .volatility(2.0) .build()); HullWhiteOneFactorVolatilityTable.builder() .entries(entries) .build(); }
@Test(expectedExceptions = IllegalArgumentException.class) public void tableWithDisjointEntriesIsNotValid() { SortedSet<HullWhiteOneFactorVolatilityEntry> entries = ImmutableSortedSet.of( HullWhiteOneFactorVolatilityEntry.builder() .startTenor(Tenor.ofDays(0)) .endTenor(Tenor.ofDays(5)) .volatility(1.0) .build(), HullWhiteOneFactorVolatilityEntry.builder() .startTenor(Tenor.ofDays(7)) .endTenor(Tenor.ofDays(10)) .volatility(2.0) .build()); HullWhiteOneFactorVolatilityTable.builder() .entries(entries) .build(); }
@Test(expectedExceptions = IllegalArgumentException.class) public void tableWithNonZeroStartIsNotValid() { SortedSet<HullWhiteOneFactorVolatilityEntry> entries = ImmutableSortedSet.of( HullWhiteOneFactorVolatilityEntry.builder() .startTenor(Tenor.ofDays(1)) .endTenor(Tenor.ofDays(5)) .volatility(1.0) .build(), HullWhiteOneFactorVolatilityEntry.builder() .startTenor(Tenor.ofDays(5)) .volatility(2.0) .build()); HullWhiteOneFactorVolatilityTable.builder() .entries(entries) .build(); }
@Test(expectedExceptions = IllegalArgumentException.class) public void tableWithFixedEndIsNotValid() { SortedSet<HullWhiteOneFactorVolatilityEntry> entries = ImmutableSortedSet.of( HullWhiteOneFactorVolatilityEntry.builder() .startTenor(Tenor.ofDays(0)) .endTenor(Tenor.ofDays(5)) .volatility(1.0) .build(), HullWhiteOneFactorVolatilityEntry.builder() .startTenor(Tenor.ofDays(5)) .endTenor(Tenor.ofDays(10)) .volatility(2.0) .build()); HullWhiteOneFactorVolatilityTable.builder() .entries(entries) .build(); }
@Test(expectedExceptions = IllegalArgumentException.class) public void tableWithEmptyEndTenorInMiddleIsNotValid() { SortedSet<HullWhiteOneFactorVolatilityEntry> entries = ImmutableSortedSet.of( HullWhiteOneFactorVolatilityEntry.builder() .startTenor(Tenor.ofDays(0)) .volatility(1.0) .build(), HullWhiteOneFactorVolatilityEntry.builder() .startTenor(Tenor.ofDays(5)) .endTenor(Tenor.ofDays(10)) .volatility(2.0) .build()); HullWhiteOneFactorVolatilityTable.builder() .entries(entries) .build(); }
@Test(expectedExceptions = IllegalArgumentException.class) public void tableWithNoEntriesIsNotValid() { HullWhiteOneFactorVolatilityTable.builder() .entries(ImmutableSortedSet.<HullWhiteOneFactorVolatilityEntry>of()) .build(); }