private synchronized void addBaseClass(RefClass refClass) {
    if (myBases == null) {
      myBases = refClass;
    }
    else if (myBases instanceof RefClass) {
      HashSet<RefClass> set = new HashSet<>();
      set.add((RefClass)myBases);
      set.add(refClass);
      myBases = set;
    }
    else {
      //noinspection unchecked
      ((Set<RefClass>)myBases).add(refClass);
    }
  }
private synchronized void addBaseClass(RefClass refClass)