public static <T extends User> Integer compareProperties(T t1, T t2) throws Exception{
		
		
		for(String name: t1.fieldsToCompare()){
			logger.info("comparing property {} ",name);
			Object property1 = PropertyUtils.getProperty(t1, name);
			Object property2 = PropertyUtils.getProperty(t2, name);
			
			if (property1 == null && property2 == null){
	        	logger.info("both properties are null continue with next");
	        	continue;
	        } else if ((property1 == null && property2 != null) || (property2==null && property1!=null)) {
	        	logger.info("difference in field {} ",name);        
	            return Integer.valueOf(-1);		                
	        
	        } else if (!property1.equals(property2)) {
	        	logger.info("difference in field {} ",name);
	           return Integer.valueOf(-1);		                
	        } 
			
			
		}
	
		
		return Integer.valueOf(0);
	}