@SuppressWarnings("unchecked") public static <T extends DimensionalItemObject>List<T> asTypedList(Collection<DimensionalItemObject> collection){
  List<T> list=new ArrayList<>();
  if (collection != null) {
    for (    DimensionalItemObject object : collection) {
      list.add((T)object);
    }
  }
  return list;
}

@ SuppressWarnings ( "unchecked" ) public static < T extends DimensionalItemObject > List < T > asTypedList ( Collection < DimensionalItemObject > collection ) { List < T > list = new ArrayList < > ( ) ; if ( collection != null ) { for ( DimensionalItemObject object : collection ) { list . add ( ( T ) object ) ; } } return list ; }
returns a list typed with the desired erasure based on the given collection . this operation implies an unchecked cast and it is the responsibility of the caller to make sure the cast is valid . a copy of the given list will be returned .
