281 |
|
public static boolean atLeastJava6() { return JAVA_CLASS_VERSION >= 50.0; } |
282 |
|
public static boolean atLeastJava7() { return JAVA_CLASS_VERSION >= 51.0; } |
283 |
|
public static boolean atLeastJava8() { return JAVA_CLASS_VERSION >= 52.0; } |
284 |
< |
public static boolean atLeastJava9() { return JAVA_CLASS_VERSION >= 53.0; } |
284 |
> |
public static boolean atLeastJava9() { |
285 |
> |
return JAVA_CLASS_VERSION >= 53.0 |
286 |
> |
// As of 2015-09, java9 still uses 52.0 class file version |
287 |
> |
|| JAVA_SPECIFICATION_VERSION.matches("^(1\\.)?(9|[0-9][0-9])$"); |
288 |
> |
} |
289 |
> |
public static boolean atLeastJava10() { |
290 |
> |
return JAVA_CLASS_VERSION >= 54.0 |
291 |
> |
|| JAVA_SPECIFICATION_VERSION.matches("^(1\\.)?[0-9][0-9]$"); |
292 |
> |
} |
293 |
|
|
294 |
|
/** |
295 |
|
* Collects all JSR166 unit tests as one suite. |
489 |
|
} |
490 |
|
|
491 |
|
/** |
492 |
< |
* Returns a new Date instance representing a time delayMillis |
493 |
< |
* milliseconds in the future. |
492 |
> |
* Returns a new Date instance representing a time at least |
493 |
> |
* delayMillis milliseconds in the future. |
494 |
|
*/ |
495 |
|
Date delayedDate(long delayMillis) { |
496 |
< |
return new Date(System.currentTimeMillis() + delayMillis); |
496 |
> |
// Add 1 because currentTimeMillis is known to round into the past. |
497 |
> |
return new Date(System.currentTimeMillis() + delayMillis + 1); |
498 |
|
} |
499 |
|
|
500 |
|
/** |