Returns a copy of this OffsetDateTime with minute-of-hour replaced with the provided 'minute'
  

package com.logicbig.example.offsetdatetime;
import java.time.OffsetDateTime;
import java.time.ZoneOffset;
public class WithMinuteExample {
    public static void main(String... args) {
        OffsetDateTime d = OffsetDateTime.of(2015, 10, 5, 15,
                30, 10, 1000000, ZoneOffset.ofHours(-5));
        System.out.println(d);
        OffsetDateTime d2 = d.withMinute(49);
        System.out.println(d2);
    }
}
Output
2015-10-05T15:30:10.001-05:00
2015-10-05T15:49:10.001-05:00
  If the provided minute is invalid. 

package com.logicbig.example.offsetdatetime;
import java.time.OffsetDateTime;
import java.time.ZoneOffset;
public class WithMinuteExample2 {
    public static void main(String... args) {
        OffsetDateTime d = OffsetDateTime.of(2015, 10, 5, 15,
                30, 10, 1000000, ZoneOffset.ofHours(-5));
        System.out.println(d);
        OffsetDateTime d2 = d.withMinute(-49);
        System.out.println(d2);
    }
} 
Output
Caused by: java.time.DateTimeException: Invalid value for MinuteOfHour (valid values 0 - 59): -49
	at java.time.temporal.ValueRange.checkValidValue(ValueRange.java:311)
	at java.time.temporal.ChronoField.checkValidValue(ChronoField.java:703)
	at java.time.LocalTime.withMinute(LocalTime.java:890)
	at java.time.LocalDateTime.withMinute(LocalDateTime.java:1067)
	at java.time.OffsetDateTime.withMinute(OffsetDateTime.java:1076)
	at com.logicbig.example.offsetdatetime.WithMinuteExample2.main(WithMinuteExample2.java:19)
	... 6 more