diff --git a/src/main/java/io/jbock/util/Either.java b/src/main/java/io/jbock/util/Either.java index bbc826c..f793be7 100644 --- a/src/main/java/io/jbock/util/Either.java +++ b/src/main/java/io/jbock/util/Either.java @@ -82,17 +82,20 @@ public static Either right(R value) { * If the provided list is empty, returns an empty {@link Optional}. * Otherwise, returns an {@code Optional} containing the list. * - * @param failures a failures - * @param the type of the members of the failures - * @return an {@code Optional} which is empty if and only if {@code failures} + *

This utility method can sometimes be used to express a + * {@link #filter(Function)} operation more efficiently. + * + * @param values a list of objects + * @param the type of the members of {@code values} + * @return an {@code Optional} which is empty if and only if {@code values} * is empty */ - public static Optional> optionalList(List failures) { - if (failures.isEmpty()) { + public static Optional> optionalList(List values) { + if (values.isEmpty()) { return Optional.empty(); } @SuppressWarnings("unchecked") - List result = (List) failures; + List result = (List) values; return Optional.of(result); }