DayCountFactory extends AbstractNamedInstanceFactory<DayCount> { private DayCountFactory() { super(DayCount.class); loadFromProperties(); } private  DayCountFactory(); @FromString static DayCount of(final String name); static final DayCountFactory INSTANCE; }
@Test public void testDayCountFactory() { final DayCount u30_360 = new ThirtyUThreeSixty(); assertEquals(u30_360, DayCounts.THIRTY_U_360); assertEquals(u30_360, DayCountFactory.INSTANCE.instance("360/360")); final DayCount a365f = new ActualThreeSixtyFive(); assertEquals(a365f, DayCountFactory.INSTANCE.instance("A/365F")); final DayCount oneone = new OneOneDayCount(); assertEquals(oneone, DayCountFactory.INSTANCE.instance("1/1")); final DayCount thirtyE = new ThirtyEThreeSixty(); assertEquals(thirtyE, DayCountFactory.INSTANCE.instance("30E/360")); assertEquals(thirtyE, DayCountFactory.INSTANCE.instance("EuroBond Basis")); }