public StatisticsType addType(StatisticsType t) {
    StatisticsType result = t;
    synchronized (statTypes) {
      StatisticsType currentValue = findType(result.getName());
      if (currentValue == null) {
        statTypes.put(result.getName(), result);
      } else if (result.equals(currentValue)) {
        result = currentValue;
      } else {
        throw new IllegalArgumentException(
            String.format("Statistics type named %s already exists.",
                result.getName()));
      }
    }
    return result;
  }
Adds an already created type. If the type has already been added and is equal to the new one
then the new one is dropped and the existing one returned.

@throws IllegalArgumentException if the type already exists and is not equal to the new type
geode-core/src/main/java/org/apache/geode/internal/statistics/StatisticsTypeFactoryImpl.java