ChangeGiver { public static int getTotalNumberOfWays(int cents) { int ways = 0; if (cents > 5) { ways = getTotalNumberOfWays(cents - 5) + getTotalNumberOfWays(cents - 1); } else if (cents == 5) { ways = 1 + getTotalNumberOfWays(cents - 1) ; } else if (cents > 0) { ways = 1; } return ways; }  static int getTotalNumberOfWays(int cents);  }
@Test public void givenATotalOf1CentWhenWeGetChangeThenThereIsOneWay() { int expected = 1; int actual = ChangeGiver.getTotalNumberOfWays(1); assertEquals(expected, actual); }
@Test public void givenATotalOf2CentsWhenWeGetChangeThenThereIsOneWay() { int expected = 1; int actual = ChangeGiver.getTotalNumberOfWays(2); assertEquals(expected, actual); }
@Test public void givenATotalOf5CentsWhenWeGetChangeThenThereIsTwoWays() { int expected = 2; int actual = ChangeGiver.getTotalNumberOfWays(5); assertEquals(expected, actual); }