### Question:
FederatedRepositoryConnection implements RepositoryConnection { protected boolean shouldProcessSynchronously( Request request ) { if (RequestType.COMPOSITE == request.getType()) { CompositeRequest composite = (CompositeRequest)request; if (composite.size() == 1) return true; return false; } return true; } FederatedRepositoryConnection( FederatedRepository repository,
                                   Observer observer ); CachePolicy getDefaultCachePolicy(); String getSourceName(); XAResource getXAResource(); boolean ping( long time,
                         TimeUnit unit ); void execute( ExecutionContext context,
                         final Request request ); void close();  }### Answer:
@Test public void shouldProcessNonCompositeRequestSynchronously() { Request request = mock(Request.class); assertThat(connection.shouldProcessSynchronously(request), is(true)); }
@Test public void shouldProcessCompositeRequestWithOneRequestSynchronously() { CompositeRequest request = mock(CompositeRequest.class); when(request.size()).thenReturn(1); assertThat(connection.shouldProcessSynchronously(request), is(true)); }
@Ignore @Test public void shouldProcessCompositeRequestWithMultipleRequestsAsynchronously() { CompositeRequest request = mock(CompositeRequest.class); when(request.size()).thenReturn(2); assertThat(connection.shouldProcessSynchronously(request), is(false)); }