code: public static Map<String, AttributeValue> cloneItem(final Map<String, AttributeValue> item) {
          if (item == null) {
              return null;
          }
          final Map<String, AttributeValue> clonedItem = Maps.newHashMap();
          final IdentityHashMap<AttributeValue, AttributeValue> sourceDestinationMap = new IdentityHashMap<>();
  
          for (Entry<String, AttributeValue> entry : item.entrySet()) {
              if (!sourceDestinationMap.containsKey(entry.getValue())) {
                  sourceDestinationMap.put(entry.getValue(), clone(entry.getValue(), sourceDestinationMap));
              }
              clonedItem.put(entry.getKey(), sourceDestinationMap.get(entry.getValue()));
          }
          return clonedItem;
      }
docs: Helper method that clones an item
  
  @param item the item to clone
  @return a clone of item.