udunits/src/main/java/ucar/units/UnitDBImpl.java
private static final void addUnique(final Map<String, Unit> map,
			final String key, final Unit newUnit) throws UnitExistsException {
		final Unit oldUnit = map.put(key, newUnit);
		if (oldUnit != null && !oldUnit.equals(newUnit)) {
			throw new UnitExistsException(oldUnit, newUnit);
		}
	}
private static final void addUnique(final Map<String, Unit> map,
			final String key, final Unit newUnit) throws UnitExistsException {
		final Unit oldUnit = map.put(key, newUnit);
		if (oldUnit != null && !oldUnit.equals(newUnit)) {
			throw new UnitExistsException(oldUnit, newUnit);
		}
	}
Adds a unique unit to a map..

@param map
The map to be added to.
@param key
The key for the unit entry.
@param newUnit
The unit to be added.
@throws UnitExistsException
Attempt to redefine an existing unit.