This commit is contained in:
mattbradburyr3 2023-01-29 17:23:49 +00:00
parent f1cf6e13aa
commit 1fb18290ca

View File

@ -6,18 +6,18 @@ import java.util.List;
import java.util.concurrent.Callable; import java.util.concurrent.Callable;
import java.util.function.Predicate; import java.util.function.Predicate;
import java.util.stream.Collectors; import java.util.stream.Collectors;
//
//public final class CorDappHelpers { public final class CorDappHelpers {
// public static <T> T findAndExpectExactlyOne(Collection<T> collection, Predicate<? super T> filterFn, String exceptionMsg) public static <T> T findAndExpectExactlyOne(Collection<T> collection, Predicate<? super T> filterFn, String exceptionMsg)
// { {
// Collection<T> results = collection.stream().filter(filterFn).collect(Collectors.toList()); Collection<T> results = collection.stream().filter(filterFn).collect(Collectors.toList());
// if(results.size() != 1){ if(results.size() != 1){
// throw new RuntimeException(exceptionMsg); throw new RuntimeException(exceptionMsg);
// } }
// return results.iterator().next(); return results.iterator().next();
// } }
//
// public static <T> T findAndExpectExactlyOne(Collection<T> collection, String exceptionMsg) { public static <T> T findAndExpectExactlyOne(Collection<T> collection, String exceptionMsg) {
// return findAndExpectExactlyOne(collection, e -> true, exceptionMsg); return findAndExpectExactlyOne(collection, e -> true, exceptionMsg);
// } }
//} }