code: @VisibleForTesting
      public static List<IStruct> getAllTraits(IReferenceableInstance entityDefinition,
                                                TypeSystem typeSystem) throws AtlasException {
          List<IStruct> traitInfo = new LinkedList<>();
          for (String traitName : entityDefinition.getTraits()) {
              IStruct trait = entityDefinition.getTrait(traitName);
              String typeName = trait.getTypeName();
              Map<String, Object> valuesMap = trait.getValuesMap();
              traitInfo.add(new Struct(typeName, valuesMap));
              traitInfo.addAll(getSuperTraits(typeName, valuesMap, typeSystem));
          }
          return traitInfo;
      }
docs: ----- helper methods ----------------------------------------------------