public static void testDictionary(String apiKey) throws NetworkException, AnalysisException {
		DictionaryManager dictionaryManager = new DictionaryManager(apiKey);
	
		// Delete all dictionaries in our account.
		{
			for (Dictionary dict : dictionaryManager.allDictionaries()) {
				System.out.println("Deleting current dictionary: " + dict.getId());
				dictionaryManager.deleteDictionary(dict);
			}
		}

		// Create a new dictionary
		
		Dictionary newDict = Dictionary.builder().setId("developers").build();

		dictionaryManager.createDictionary(newDict);
		
		Dictionary teamsDictionary = dictionaryManager.getDictionary("developers");
		 
		System.out.println("Got dict:");
		 System.out.println(teamsDictionary.getId());

		 {
			List<DictionaryEntry> newEntries = new ArrayList<DictionaryEntry>();

			List<String> types = Arrays.asList("cpp_developer", "writer");

			newEntries.add(DictionaryEntry.builder().setText("Bjarne Stroustrup").setId("DEV2").addData("types", types).build());

			dictionaryManager.addEntries(newDict.getId(), newEntries);
		}
		
		// Loop over all entries in a specific dictionary
		PagedAllEntries allEntries = dictionaryManager.allEntries(newDict.getId());

		System.out.println("Dictionary contains : " + allEntries.getTotal() + " total entries.");
		
		for (DictionaryEntry entry : allEntries.getEntries()) {
			System.out.println("Dictionary entry in 'developers':");
			System.out.println(entry.getId() + " " + entry.getText());
		}
		
		// Retrieve them directly by ID
		{
			DictionaryEntry entry = dictionaryManager.getEntry(newDict.getId(), "DEV2");
			System.out.println("Entry text: " + entry.getText());
		}
		
		// Try extracting the new entry from some sample text.
		TextRazor client = new TextRazor(apiKey);
		
		client.setEntityDictionaries(Arrays.asList(newDict.getId()));
		client.addExtractor("entities");
		
		AnalyzedText response = client.analyze("Although it is very early in the process, higher-level parallelism is slated to be a key theme of the next version of C++, says Bjarne Stroustrup");
		
		for (Entity entity : response.getResponse().getEntities()) {
			String customEntityId = entity.getCustomEntityId();
			if (null != customEntityId) {
				System.out.println("Found custom entity: " + customEntityId);
				for (String type : entity.getData().get("types")) {
					System.out.println("Type: " + type);
				}
			}
		}
	}