get Elements
Returns a list of the elements that are of the same type as the target class. Usage: getElements(objects, String.class);
Return
a list that holds the items of the targetClass
Parameters
objects
the list that can hold anything
target Class
the class type to find in the list, should be same as T