InterestRate { public double getRate() { return _rate; } InterestRate(final double rate); double getRate(); abstract double getDiscountFactor(double t); abstract InterestRate fromContinuous(ContinuousInterestRate continuous); abstract double fromContinuousDerivative(ContinuousInterestRate continuous); abstract InterestRate fromPeriodic(PeriodicInterestRate periodic); abstract ContinuousInterestRate toContinuous(); abstract PeriodicInterestRate toPeriodic(int periodsPerYear); @Override int hashCode(); @Override boolean equals(final Object obj);  }
@Test public void testGetters() { assertEquals(RATE, ANNUAL.getRate(), 0); assertEquals(RATE, CONTINUOUS.getRate(), 0); assertEquals(RATE, QUARTERLY.getRate(), 0); }