class CDAHelper {

	public static Obs getLatestObs(List<Obs> observationList)
	{
		Map<String,Obs> latestObsdate=new HashMap<String,Obs>();
		if(observationList!=null)
		{
		if(observationList.isEmpty())
		{
			return null;
		}
		else
		{
		for (Obs obs : observationList) 
	   {
		  if(latestObsdate.isEmpty())
		  {
		  latestObsdate.put("Latest date", obs);
		  }
		   else
		  {
			      Date date=latestObsdate.get("Latest date").getObsDatetime();
			      if(date.before(obs.getObsDatetime()))
			      {
				    latestObsdate.put("Latest date", obs);
			      }
		   }
		}
		return latestObsdate.get("Latest date");
		}
		}
		
		else
			return null;
			
	}

}