BAEL-1265: Adding jUnit for article

This commit is contained in:
Radu Tamas
2017-10-31 13:35:17 +02:00
parent 4ceff2d553
commit 8c0eaac37b
2 changed files with 172 additions and 0 deletions
@@ -0,0 +1,26 @@
package com.baeldung.concurrent.executorservice;
import java.util.concurrent.Callable;
public class DelayedCallable implements Callable<String> {
private String name;
private long period;
public DelayedCallable(String name, long period) {
this.name = name;
this.period = period;
}
public String call() {
try {
Thread.sleep(period);
} catch (InterruptedException ex) {
// handle exception
ex.printStackTrace();
}
return name;
}
}