public static <T> T findElem(T elem,List<T> list){

        if(list.isEmpty()){
            return null;
        }
        if(list.get(0).equals(elem)){
            return list.get(0);
        }
        else{

            return findElem(elem, list.subList(1, list.size()));
        }

    }