code: @SuppressWarnings("unchecked")
  	public Long countLinks(ParaObject obj, String type2) {
  		if (obj == null || obj.getId() == null || type2 == null) {
  			return 0L;
  		}
  		MultivaluedMap<String, String> params = new MultivaluedHashMap<>();
  		params.putSingle("count", "true");
  		Pager pager = new Pager();
  		String url = Utils.formatMessage("{0}/links/{1}", obj.getObjectURI(), type2);
  		getItems((Map<String, Object>) getEntity(invokeGet(url, params), Map.class), pager);
  		return pager.getCount();
  	}
docs: Count the total number of links between this object and another type of object.
  @param type2 the other type of object
  @param obj the object to execute this method on
  @return the number of links for the given object