I do not recommend the Calendar API at all. JodaTime is a much better implementation, with a much more elegant design.
You have very useful methods to work with dates, including plusMonths that what you do, as you can see by name, is adding n months to your date object.
I show you examples:
The first is the case that you raise, I have 2018/05/05 and I must obtain 2018/06/05. In the second case I have 2016/01/29 (leap year) and I must get 2016/02/29
public class FechasTest {
private DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy/MM/dd");
@Test
public void debeAumentarUnMesALaFecha() {
LocalDate fecha = formatter.parseDateTime("2018/05/05").toLocalDate();
LocalDate fechaEsperada = formatter.parseDateTime("2018/06/05").toLocalDate();
assertThat(fecha.plusMonths(1)).isEqualTo(fechaEsperada);
}
@Test
public void obtengo29DeFebreroPorqueEsUnAnioBisiesto() {
LocalDate fecha = formatter.parseDateTime("2016/01/29").toLocalDate();
LocalDate fechaEsperada = formatter.parseDateTime("2016/02/29").toLocalDate();
assertThat(fecha.plusMonths(1)).isEqualTo(fechaEsperada);
}
}