|
|
@@ -22,6 +22,7 @@ import java.util.Date;
|
|
|
import java.util.Iterator;
|
|
|
import java.util.Map;
|
|
|
import java.util.Objects;
|
|
|
+import java.util.Optional;
|
|
|
import java.util.function.BiPredicate;
|
|
|
import java.util.function.Predicate;
|
|
|
|
|
|
@@ -247,6 +248,18 @@ public final class NewAssert extends org.junit.Assert {
|
|
|
public static void assertEquals(Date a, Date b, long dt) {
|
|
|
assertTrue(a + " and " + b + " are not equal", Math.abs(a.getTime() - b.getTime()) <= dt);
|
|
|
}
|
|
|
+
|
|
|
+ public static void assertEmpty(Optional<?> value) {
|
|
|
+ assertFalse("Optional should be empty", value.isPresent());
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void assertEmpty(Collection<?> value) {
|
|
|
+ assertTrue("Collection should be empty", value.isEmpty());
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void assertEmpty(Map<?,?> value) {
|
|
|
+ assertTrue("Map should be empty", value.isEmpty());
|
|
|
+ }
|
|
|
|
|
|
public interface Action {
|
|
|
|