private YearMonth with ( int newYear , int newMonth ) { if ( year == newYear && month == newMonth ) { return this ; } return new YearMonth ( newYear , newMonth ) ; }
Returns a copy of this year - month with the new year and month checking to see if a new object is in fact required .