code: public boolean lessThanOrEqual(@Nonnull ResourceSpec other) {
  		int cmp1 = Double.compare(this.cpuCores, other.cpuCores);
  		int cmp2 = Integer.compare(this.heapMemoryInMB, other.heapMemoryInMB);
  		int cmp3 = Integer.compare(this.directMemoryInMB, other.directMemoryInMB);
  		int cmp4 = Integer.compare(this.nativeMemoryInMB, other.nativeMemoryInMB);
  		int cmp5 = Integer.compare(this.stateSizeInMB, other.stateSizeInMB);
  		if (cmp1 <= 0 && cmp2 <= 0 && cmp3 <= 0 && cmp4 <= 0 && cmp5 <= 0) {
  			for (Resource resource : extendedResources.values()) {
  				if (!other.extendedResources.containsKey(resource.getName()) ||
  					other.extendedResources.get(resource.getName()).getResourceAggregateType() != resource.getResourceAggregateType() ||
  						other.extendedResources.get(resource.getName()).getValue() < resource.getValue()) {
  					return false;
  				}
  			}
  			return true;
  		}
  		return false;
  	}
docs: Checks the current resource less than or equal with the other resource by comparing
  all the fields in the resource.
  
  @param other The resource to compare
  @return True if current resource is less than or equal with the other resource, otherwise return false.