@VisibleForTesting protected static void addAttribute(Class<? extends Context> contextClass,Attribute<?> attribute){
  Set<String> attributeNames=CONTEXT_CLASS_TO_ATTRIBUTES.get(contextClass);
  if (attributeNames == null) {
    attributeNames=Sets.newHashSet();
    CONTEXT_CLASS_TO_ATTRIBUTES.put(contextClass,attributeNames);
  }
  attributeNames.add(attribute.getSimpleName());
  CONTEXT_CLASSES.add(contextClass);
  Map<String,Attribute<?>> attributeMap=CONTEXT_TO_ATTRIBUTE_NAME_TO_ATTRIBUTE.get(contextClass);
  if (attributeMap == null) {
    attributeMap=Maps.newHashMap();
    CONTEXT_TO_ATTRIBUTE_NAME_TO_ATTRIBUTE.put(contextClass,attributeMap);
  }
  attributeMap.put(attribute.getSimpleName(),attribute);
}

@ VisibleForTesting protected static void addAttribute ( Class < ? extends Context > contextClass , Attribute < ? > attribute ) { Set < String > attributeNames = CONTEXT_CLASS_TO_ATTRIBUTES . get ( contextClass ) ; if ( attributeNames == null ) { attributeNames = Sets . newHashSet ( ) ; CONTEXT_CLASS_TO_ATTRIBUTES . put ( contextClass , attributeNames ) ; } attributeNames . add ( attribute . getSimpleName ( ) ) ; CONTEXT_CLASSES . add ( contextClass ) ; Map < String , Attribute < ? > > attributeMap = CONTEXT_TO_ATTRIBUTE_NAME_TO_ATTRIBUTE . get ( contextClass ) ; if ( attributeMap == null ) { attributeMap = Maps . newHashMap ( ) ; CONTEXT_TO_ATTRIBUTE_NAME_TO_ATTRIBUTE . put ( contextClass , attributeMap ) ; } attributeMap . put ( attribute . getSimpleName ( ) , attribute ) ; }
this method is only used for testing .
