@Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    InMemoryLookupCache that = (InMemoryLookupCache) o;

    if (numDocs != that.numDocs) return false;
    if (wordIndex != null ? !wordIndex.equals(that.wordIndex) : that.wordIndex != null)
      return false;
    if (wordFrequencies != null
        ? !wordFrequencies.equals(that.wordFrequencies)
        : that.wordFrequencies != null) return false;
    if (docFrequencies != null
        ? !docFrequencies.equals(that.docFrequencies)
        : that.docFrequencies != null) return false;
    if (vocabWords().equals(that.vocabWords())) return true;

    return true;
  }