resolving bug caused by mixing autoboxing with generics