@Override
    public int hashCode() {
      int result = stackRoot != null ? stackRoot.hashCode() : 0;
      result = 31 * result + (commonServicesRoot != null ? commonServicesRoot.hashCode() : 0);
      result = 31 * result + (extensionRoot != null ? extensionRoot.hashCode() : 0);
      return result;
    }
Directory tree rescans and stack modules parsing take much time on every module init.
This class enhances {@code}StackManager{@code} to reuse already parsed modules.
ambari-server/src/test/java/org/apache/ambari/server/stack/StackManagerMock.java