How to check if an Object is a Collection Type in Java? January 29, 2023 by Tarik if (x instanceof Collection<?>){ } if (x instanceof Map<?,?>){ }