code: public SortedMultiMap<Double,String> getMostSimilar(
              final String word, final SemanticSpace sspace,
              int numberOfSimilarWords, Similarity.SimType similarityType) {
  
          Vector v = sspace.getVector(word);
  
          // if the semantic space did not have the word, then return null
          if (v == null) {
              return null;
          }
          
          final Vector vector = v;
  
          Set<String> words = sspace.getWords();
          
          // the most-similar set will automatically retain only a fixed number
          // of elements
          final SortedMultiMap<Double,String> mostSimilar =
              new BoundedSortedMultiMap<Double,String>(numberOfSimilarWords,
                                                       false);
  
          // The semaphore used to block until all the words have been compared.
          // Use word-2 since we don't process the comparison of the word to
          // itself, and we want one permit to be availabe after the last word is
          // compared.  The negative ensures that the release() must happen before
          // the main thread's acquire() will return.
          final Semaphore comparisons = new Semaphore(0 - (words.size() - 2));
  
          // loop through all the other words computing their
          // similarity
          int submitted = 0;
          for (String s : words) {
  
              final String other = s;
              
              // skip if it is ourselves
              if (word.equals(other)) 
                  continue;
  
               workQueue.offer(new Comparison(
                           comparisons, sspace, vector,
                           other, similarityType, mostSimilar));
          }
          
          try {
              comparisons.acquire();
          } catch (InterruptedException ie) {
              // check whether we were interrupted while still waiting for the
              // comparisons to finish
               if (comparisons.availablePermits() < 1) {
                  throw new IllegalStateException(
                      "interrupted while waiting for word comparisons to finish", 
                      ie);
               }
          }
          
          //System.out.println(executor.shutdownNow())
          return mostSimilar;
      }
docs: Compares the provided word to all other words in the provided {@link
  SemanticSpace} and return the specified number of words that were most
  similar according to the specified similarity measure.
  
  @return the most similar words, or {@code null} if the provided word was
  not in the semantic space.