If we go with JDK 9 modularity, then our classes will live inside modules. The Pair class is not in a module, but we can easily get the module of a class via JDK 9's Class.getModule() method (if the class is not in a module, then this method returns null):
// null, since Pair is not in a Module
Module module = clazz.getModule();