Skip to content

Instantly share code, notes, and snippets.

View AndrienkoAleksandr's full-sized avatar

Oleksandr Andriienko AndrienkoAleksandr

View GitHub Profile
@AndrienkoAleksandr
AndrienkoAleksandr / gist:b78b0e4e17b9c4facf90
Created August 10, 2014 17:41
callable without ExecutorService
public class Application2 {
public static class WordLengthCallable implements Callable {
public static int count = 0;
private final int numberOfThread = count++;
public Integer call() throws InterruptedException {
int sum = 0;
for (int i = 0; i < 100000; i++) {
sum += i;
}
@AndrienkoAleksandr
AndrienkoAleksandr / gist:747b5de2494f78e9be35
Last active August 29, 2015 14:05
Callable without ExecutorService2
public class CallableWithoutExecutorService2 {
public static class WordLengthCallable implements Callable {
public static int count = 0;
private final int numberOfThread = count++;
public Integer call() throws InterruptedException {
int sum = 0;
for (int i = 0; i < 100000; i++) {
sum += i;
@AndrienkoAleksandr
AndrienkoAleksandr / ArgumentCaptor
Created September 10, 2014 15:58
ArgumentCaptor vs doAnswer
ArgumentCaptor<UserChangedCallBack> userCapture = ArgumentCaptor.forClass(UserChangedCallBack.class);
doNothing().when(dialogBoxPresenter).showDialog(any(User.class), userCapture.capture());
usersListPresenter.onAddButtonClicked();
userCapture.getValue().onChanged(user);
ArgumentCaptor<UserChangedCallBack> userCapture = ArgumentCaptor.forClass(UserChangedCallBack.class);
usersListPresenter.onAddButtonClicked();
verify(dialogBoxPresenter).showDialog(any(User.class), userCapture.capture());
userCapture.getValue().onChanged(user);
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy.MM.dd HH:mm:s");
String date = dateFormat.format(System.currentTimeMillis());
FROM aandrienko/test_private_repository_for_eclipse_che
FROM test_private_repository_for_eclipse_che
FROM codenvy/debian_jdk8
FROM aandrienko/test
FROM aandrienko/test