code: @Nullable
      public static String setVariantForView(@NonNull View view, @Nullable String variant) {
          String previousVariant = null;
          String previousAttribute = null;
          for (Map.Entry<String, HashMap<Integer, String>> entry : bindings.entrySet()) {
              if (entry.getValue().containsKey(view.getId())) {
                  previousVariant = entry.getKey();
                  previousAttribute = entry.getValue().get(view.getId());
                  bindings.remove(previousVariant);
                  break;
              }
          }
          mapAttribute(previousAttribute, view.getId(), variant, view.getClass().getSimpleName());
          return previousVariant;
      }
docs: Associates programmatically a view with a variant.
  
  @param view any existing view.
  @return the previous variant for this view, if any.