Suggested reading: Generic Methods in Java

Java generics can't be primitive types (int, float, double, etc.), but luckily Java has auto-boxing. You can somewhat restrict the type you can pass in...