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