public class Control extends Object
Modifier and Type | Field and Description |
---|---|
protected static ThreadLocal<Long> |
timestampLocal
|
Modifier and Type | Method and Description |
---|---|
static void |
assertTrue(boolean value)
Asserts that a condition is
true . |
static int |
checkEquals(int a,
int b)
Checks if two
int s are equal. |
static int |
checkEquals(int a,
int b,
String message)
Checks if two
int s are equal. |
static <T> T |
checkEquals(T a,
T b)
Checks if two objects are equal.
|
static <T> T |
checkEquals(T a,
T b,
String message)
Checks if two objects are equal.
|
static void |
checkTrue(boolean value)
Checks if a condition is
true . |
static void |
checkTrue(boolean value,
String message)
Checks if a condition is
true . |
protected static void |
ensureTrue(boolean value,
boolean isAssertion,
String message)
An internal check/assert method that backs the likes of
checkTrue(boolean) and
assertTrue(boolean) . |
static void |
sleep(long millis)
Sleeps for the given number of milliseconds.
|
static void |
tick()
Starts the timer for
Thread.currentThread() . |
static long |
tock()
Stops the timer for
Thread.currentThread() . |
static <T> Iterator<T> |
unmodifiableIterator(Iterator<T> itr)
Creates an unmodifiable
Iterator from a possibly modifiable one. |
protected static final ThreadLocal<Long> timestampLocal
public static final void sleep(long millis)
public static final <T> Iterator<T> unmodifiableIterator(Iterator<T> itr)
Iterator
from a possibly modifiable one.public static final void tick()
Thread.currentThread()
.public static final long tock()
Thread.currentThread()
.public static final void checkTrue(boolean value)
true
.public static final void assertTrue(boolean value)
true
.public static final int checkEquals(int a, int b)
int
s are equal.a
- the first argument.b
- the second argument.public static final <T> T checkEquals(T a, T b)
T
- the object parameterization.a
- the first argument.b
- the second argument.public static final void checkTrue(boolean value, String message)
true
.value
- the truth value to check.message
- the failure message.public static final int checkEquals(int a, int b, String message)
int
s are equal.a
- the first argument.b
- the second argument.message
- the failure message.public static final <T> T checkEquals(T a, T b, String message)
T
- the object parameterization.a
- the first argument.b
- the second argument.message
- the failure message.protected static final void ensureTrue(boolean value, boolean isAssertion, String message) throws RuntimeException, AssertionError
checkTrue(boolean)
and
assertTrue(boolean)
.value
- the truth value.isAssertion
- if a failed check results in an AssertionError
.message
- the failure message.RuntimeException
- when a check fails.AssertionError
- when an assertion fails.