StubCalculator { public static StubType getEndStubType(final LocalDate[] schedule, final int paymentsPerYear) { return getEndStubType(schedule, paymentsPerYear, false); } private  StubCalculator(); static StubType getStartStubType(final LocalDate[] schedule, final int paymentsPerYear); static StubType getStartStubType(final LocalDate[] schedule, final double paymentsPerYear, final boolean isEndOfMonthConvention); static StubType getEndStubType(final LocalDate[] schedule, final int paymentsPerYear); static StubType getEndStubType(final LocalDate[] schedule, final double paymentsPerYear, final boolean isEndOfMonthConvention);  }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNullSchedule3() { StubCalculator.getEndStubType((LocalDate[]) null, 1); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNullInSchedule3() { StubCalculator.getEndStubType(new LocalDate[] {null, null}, 1); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNegativePayments4() { StubCalculator.getEndStubType(NO_STUB2, -1); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testBadPayments4() { StubCalculator.getEndStubType(NO_STUB2, 5); }
@Test public void testEndType() { assertEquals(StubCalculator.getEndStubType(NO_STUB2, 4), StubType.NONE); assertEquals(StubCalculator.getEndStubType(SHORT_START_STUB2, 4), StubType.NONE); assertEquals(StubCalculator.getEndStubType(LONG_START_STUB2, 4), StubType.NONE); assertEquals(StubCalculator.getEndStubType(SHORT_END_STUB2, 4), StubType.SHORT_END); assertEquals(StubCalculator.getEndStubType(LONG_END_STUB2, 4), StubType.LONG_END); assertEquals(StubCalculator.getEndStubType(NO_STUB4, 4), StubType.NONE); assertEquals(StubCalculator.getEndStubType(SHORT_START_STUB4, 4), StubType.NONE); assertEquals(StubCalculator.getEndStubType(LONG_START_STUB4, 4), StubType.NONE); assertEquals(StubCalculator.getEndStubType(SHORT_END_STUB4, 4), StubType.SHORT_END); assertEquals(StubCalculator.getEndStubType(LONG_END_STUB4, 4), StubType.LONG_END); assertEquals(StubCalculator.getEndStubType(NO_STUB4, 4, true), StubType.NONE); assertEquals(StubCalculator.getEndStubType(SHORT_START_STUB4, 4, true), StubType.NONE); assertEquals(StubCalculator.getEndStubType(LONG_START_STUB4, 4, true), StubType.NONE); assertEquals(StubCalculator.getEndStubType(SHORT_END_STUB4, 4, true), StubType.SHORT_END); assertEquals(StubCalculator.getEndStubType(LONG_END_STUB4, 4, true), StubType.LONG_END); }