code: @SuppressWarnings("unchecked")
    @Override
    public <T> List<T> getCollection(Class<T> entityClass) {
      String collectionName = Util.determineCollectionName(entityClass);
      Map<Object, T> collection = (Map<Object, T>) collectionsRef.get().get(collectionName);
      if (null == collection) {
        createCollection(collectionName);
        collection = (Map<Object, T>) collectionsRef.get().get(collectionName);
      }
  
      CollectionMetaData cmd = cmdMap.get(collectionName);
      List<T> newCollection = new ArrayList<T>();
      try {
        for (T document : collection.values()) {
          Object obj = Util.deepCopy(document);
          if(encrypted && cmd.hasSecret() && null != obj) {
            CryptoUtil.decryptFields(obj, cmd, dbConfig.getCipher());
          }
          newCollection.add((T) obj);
        }
      } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
        logger.error("Error when decrypting value for a @Secret annotated field for entity: " + collectionName, e);
        throw new JsonDBException("Error when decrypting value for a @Secret annotated field for entity: " + collectionName, e);
      }
      return newCollection;
    }
docs: /* (non-Javadoc)
  @see io.jsondb.JsonDBOperations#getCollection(java.lang.Class)