summaryrefslogtreecommitdiff
path: root/base/src/main/java/bjc/utils/funcutils/TestUtils.java
diff options
context:
space:
mode:
Diffstat (limited to 'base/src/main/java/bjc/utils/funcutils/TestUtils.java')
-rw-r--r--base/src/main/java/bjc/utils/funcutils/TestUtils.java31
1 files changed, 13 insertions, 18 deletions
diff --git a/base/src/main/java/bjc/utils/funcutils/TestUtils.java b/base/src/main/java/bjc/utils/funcutils/TestUtils.java
index 3aa20a2..bf38cbe 100644
--- a/base/src/main/java/bjc/utils/funcutils/TestUtils.java
+++ b/base/src/main/java/bjc/utils/funcutils/TestUtils.java
@@ -15,27 +15,22 @@ public class TestUtils {
/**
* Assert an iterator provides a particular sequence of values.
*
- * @param src
- * The iterator to pull values from.
- * @param vals
- * The values to expect from the iterator.
+ * @param <T> The type of the values.
+ * @param src The iterator to pull values from.
+ * @param vals The values to expect from the iterator.
*/
@SafeVarargs
public static <T> void assertIteratorEquals(Iterator<T> src, T... vals) {
- for (T val : vals) {
- assertEquals(val, src.next());
- }
+ for (T val : vals) assertEquals(val, src.next());
}
/**
* Assert an iterator provides a particular sequence of values.
*
- * @param src
- * The iterator to pull values from.
- * @param hasMore
- * The expected value of hasNext for the iterator.
- * @param vals
- * The values to expect from the iterator.
+ * @param <T> The type of the values.
+ * @param src The iterator to pull values from.
+ * @param hasMore The expected value of hasNext for the iterator.
+ * @param vals The values to expect from the iterator.
*/
@SafeVarargs
public static <T> void assertIteratorEquals(boolean hasMore, Iterator<T> src,
@@ -46,6 +41,8 @@ public class TestUtils {
* Even though it's awkward, the boolean has to come first. Otherwise, there are
* cases where the compiler will get confused as to what the right value for T
* is, and be unable to pick an overload.
+ *
+ * This is a case where named parameter would be rather useful.
*/
assertIteratorEquals(src, vals);
@@ -55,11 +52,9 @@ public class TestUtils {
/**
* Assert that a list has a given set of contents.
*
- * @param src
- * The list of actual elements.
- *
- * @param exps
- * The list of expected elements.
+ * @param <T> The type of the values.
+ * @param src The list of actual elements.
+ * @param exps The list of expected elements.
*/
@SafeVarargs
public static <T> void assertListEquals(List<T> src, T... exps) {