package com.iluwatar.callback;

import org.junit.Test;

import com.iluwatar.callback.App;

/**
 * 
 * Application test
 *
 */
public class AppTest {

	@Test
	public void test() {
		String[] args = {};
		App.main(args);
	}
}

@@ -60,164 +60,891 @@
 ort 
-com.iluwatar.callback.App;%0A%0A/**%0A * %0A * Application test%0A *%0A */%0Apublic class AppTest %7B%0A%0A%09@Test%0A%09public void test() %7B%0A%09%09String%5B%5D args = %7B%7D;%0A%09%09App.main(args
+static org.junit.Assert.assertEquals;%0A%0A/**%0A * Add a field as a counter. Every time the callback method is called increment this%0A * field. Unit test checks that the field is being incremented.%0A *%0A * Could be done with mock objects as well where the call method call is verified.%0A */%0Apublic class AppTest %7B%0A%0A    private Integer callingCount = 0;%0A%0A%09@Test%0A%09public void test() %7B%0A        Callback callback = new Callback() %7B%0A            @Override%0A            public void call() %7B%0A                callingCount++;%0A            %7D%0A        %7D;%0A%0A        Task task = new SimpleTask();%0A%0A        assertEquals(%22Initial calling count of 0%22, new Integer(0), callingCount);%0A%0A        task.executeWith(callback);%0A%0A        assertEquals(%22Callback called once%22, new Integer(1), callingCount);%0A%0A        task.executeWith(callback);%0A%0A        assertEquals(%22Callback called twice%22, new Integer(2), callingCount
 );%0A
+%0A
 %09%7D%0A%7D

Add unit test to show that the callback method is called.