package seedu.address.testutil;

import junit.framework.AssertionFailedError;

/**
 * A set of assertion methods useful for writing tests.
 */
public class Assert {

    /**
     * Asserts that the {@code executable} throws the {@code expected} Exception.
     */
    public static void assertThrows(Class<? extends Throwable> expected, Runnable executable) {
        try {
            executable.run();
        } catch (Throwable actualException) {
            if (actualException.getClass().isAssignableFrom(expected)) {
                return;
            }
            String message = String.format("Expected thrown: %s, actual: %s", expected.getName(),
                    actualException.getClass().getName());
            throw new AssertionFailedError(message);
        }
        throw new AssertionFailedError(
                String.format("Expected %s to be thrown, but nothing was thrown.", expected.getName()));
    }
}

@@ -198,22 +198,20 @@
  %7B@code 
-execut
+call
 able%7D th
@@ -332,23 +332,25 @@
 ed, 
-Runnable execut
+VoidCallable call
 able
@@ -383,22 +383,21 @@
     
-execut
+call
 able.
-run
+call
 ();%0A
@@ -924,10 +924,221 @@
 ;%0A    %7D%0A
+%0A    /**%0A     * Represents a function which does not return anything and may throw an exception.%0A     */%0A    @FunctionalInterface%0A    public interface VoidCallable %7B%0A        void call() throws Exception;%0A    %7D%0A%0A
 %7D%0A

support checked exceptions