class AdminService {

	public SearchResult search(String symbolOrName) throws IOException {
		final List<UpdatedPair> existingSymbols;
		final List<LookupInfo> availableSymbols;

		if (Strings.isNullOrEmpty(symbolOrName)) {
			existingSymbols = pairService.getAll();
			availableSymbols = new ArrayList<>();
		} else {
			existingSymbols = pairService.getAllWithSymbolOrNameContaining(symbolOrName);
			availableSymbols = lookupService.search(symbolOrName);
			removeDuplicates(availableSymbols, existingSymbols);
		}
		
		return new SearchResult(existingSymbols, availableSymbols);
	}

}