class HerdCollectionHelper {

    public <T> T safeGet(List<T> list, int index)
    {
        if (list != null && index < list.size())
        {
            return list.get(index);
        }
        return null;
    }

}