### Question:
JsonRestClient implements IRestClient { public Collection<Repository> getRepositories( Server server ) throws Exception { assert server != null; LOGGER.trace("getRepositories: server={0}", server); ServerNode serverNode = new ServerNode(server); HttpClientConnection connection = connect(server, serverNode.getFindRepositoriesUrl(), RequestMethod.GET); try { int responseCode = connection.getResponseCode(); if (responseCode == HttpURLConnection.HTTP_OK) { return serverNode.getRepositories(connection.read()); } LOGGER.error(RestClientI18n.connectionErrorMsg, responseCode, "getRepositories"); String msg = RestClientI18n.getRepositoriesFailedMsg.text(server.getName(), responseCode); throw new RuntimeException(msg); } finally { if (connection != null) { LOGGER.trace("getRepositories: leaving"); connection.disconnect(); } } }  Collection<Repository> getRepositories( Server server ); @Override Map<String, javax.jcr.nodetype.NodeType> getNodeTypes( Repository repository ); URL getUrl( File file,
                       String path,
                       Workspace workspace ); Collection<Workspace> getWorkspaces( Repository repository ); boolean pathExists( Workspace workspace,
                               String path,
                               File file ); Status publish( Workspace workspace,
                           String path,
                           File file ); Status unpublish( Workspace workspace,
                             String path,
                             File file ); @Override List<QueryRow> query( Workspace workspace,
                                 String language,
                                 String statement ); @Override List<QueryRow> query( Workspace workspace,
                                 String language,
                                 String statement,
                                 int offset,
                                 int limit ); @SuppressWarnings( "unchecked" ) @Override List<QueryRow> query( Workspace workspace,
                                 String language,
                                 String statement,
                                 int offset,
                                 int limit,
                                 Map<String, String> variables ); @SuppressWarnings( "null" ) static void main( String[] args );  }### Answer:
@Test public void shouldGetRepositories() throws Exception { Collection<Repository> repositories = this.restClient.getRepositories(SERVER); assertThat(repositories.size(), equalTo(1)); assertThat(repositories.iterator().next(), is(REPOSITORY1)); }