Skip to content

Instantly share code, notes, and snippets.

View klimeryk's full-sized avatar

Igor Klimer klimeryk

View GitHub Profile
public class AppActivityMapper implements ActivityMapper {
@Override
public Activity getActivity(Place place) {
activity = null;
if (place instanceof StartPlace) {
return new StartActivity();
} else if (place instanceof SearchPlace) {
return new SearchActivity();
} else if (place instanceof CustomerPlace) {
return new CustomerActivity();
public class AnyAsyncCallback<T> extends ArgumentMatcher<AsyncCallback<T>> {
public AnyAsyncCallback() {
}
@Override
public boolean matches(Object argument) {
return argument instanceof AsyncCallback;
}
}
public class FakeEventBinderProvider implements FakeProvider<EventBinder<?>> {
@Override
public EventBinder<?> getFake(Class<?> type) {
return (EventBinder<?>) Proxy.newProxyInstance(FakeEventBinderProvider.class.getClassLoader(), new Class<?>[] { type }, new InvocationHandler() {
@Override
public Object invoke(Object proxy, Method method, final Object[] args) throws Throwable {
String methodName = method.getName();
assert methodName.equals("bindEventHandlers");
final List<HandlerRegistration> registrations = new LinkedList<HandlerRegistration>();