### Question:
JsonRestClient implements IRestClient { @Override public Map<String, javax.jcr.nodetype.NodeType> getNodeTypes( Repository repository ) throws Exception { assert repository != null; LOGGER.trace("getNodeTypes: workspace={0}", repository); Collection<Workspace> workspaces = getWorkspaces(repository); Workspace workspace = null; Workspace systemWs = null; for (Workspace wspace : workspaces) { if (wspace.getName().equalsIgnoreCase("default")) { workspace = wspace; break; } if (workspace == null && !wspace.getName().equalsIgnoreCase("system")) { workspace = wspace; } if (wspace.getName().equalsIgnoreCase("system")) { systemWs = wspace; } } if (workspace == null) { workspace = systemWs; } NodeTypeNode nodetypeNode = new NodeTypeNode(workspace); HttpClientConnection connection = connect(workspace.getServer(), nodetypeNode.getUrl(), RequestMethod.GET); try { int responseCode = connection.getResponseCode(); if (responseCode == HttpURLConnection.HTTP_OK) { return nodetypeNode.getNodeTypes(connection.read()); } LOGGER.error(RestClientI18n.connectionErrorMsg, responseCode, "getNodeTypes"); String msg = RestClientI18n.getNodeTypesFailedMsg.text(nodetypeNode.getUrl(), responseCode); throw new RuntimeException(msg); } finally { if (connection != null) { LOGGER.trace("getNodeTypes: 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:
@Ignore @Test public void shouldGetNodeTypes() throws Exception { Map<String, NodeType> nodeTypes = this.restClient.getNodeTypes(REPOSITORY1); for (Iterator<NodeType> it = nodeTypes.values().iterator(); it.hasNext();) { NodeType nt = it.next(); System.out.println("NODETYPE: " + nt.getName()); System.out.println(" declared supertypes: " + nt.getSupertypes()); System.out.println(" declared property definitions: " + nt.getDeclaredPropertyDefinitions()); System.out.println(" declared child node definitions: " + nt.getDeclaredPropertyDefinitions()); } }