docs: public static <T> T findBean(Class<T> type, ApplicationContext context) {
          Map m = context.getBeansOfType(type);
          switch(m.size()) {
          case 0:
              throw new IllegalArgumentException("No beans of "+type+" are defined");
          case 1:
              return type.cast(m.values().iterator().next());
          default:
              throw new IllegalArgumentException("Multiple beans of "+type+" are defined: "+m);            
          }
      }