org.linkedin.util-core/src/main/java/org/linkedin/util/lang/MemorySize.java
public MemorySize add(MemorySize other)
  {
    if(other == null)
      throw new NullPointerException();
    
    if(getSizeUnit() == other.getSizeUnit())
      return new MemorySize(getSize() + other.getSize(), getSizeUnit());

    return new MemorySize(getSizeInBytes() + other.getSizeInBytes(),
                        SizeUnit.BYTE);
  }
public MemorySize add(MemorySize other)
  {
    if(other == null)
      throw new NullPointerException();
    
    if(getSizeUnit() == other.getSizeUnit())
      return new MemorySize(getSize() + other.getSize(), getSizeUnit());

    return new MemorySize(getSizeInBytes() + other.getSizeInBytes(),
                        SizeUnit.BYTE);
  }
Return a new instance of MemorySize that adds up the size of this object
with that of the 'other'

@param other
@return a new instance of MemorySize that adds up the size of this object
with the that of the 'other'