code: private final ReferenceFactory<K,V> toFactory(Type type) {
          switch (type) {
              case Hard : return new HardReferenceFactory();
              case Weak : return new WeakReferenceFactory();
              case Soft : return new SoftReferenceFactory();
              default : return null;
          }
      }
docs: Create a reference factory of the given type.
  @param type type of reference factory
  @return a reference factory