It sounds like you really need to learn about interfaces (as in the java keyword, unfortunately a common word in programming :)).
“interface” in java IMHO (others here disagree :)) is really a synonym for “abstract datatype”, i.e. it lets you define new types in java.
So, what erikd is suggesting is that you create a new type of your choosing (by writing an interface) and make all your imported things of that type.
e.g. if you are loading modules you might create a “module” type which is defined as always having a “getName” method. When loading the modules, you would typecast them directly to “module”
module importedModule = (module) myMethodToImportAModule();
System.out.println( "imported module = "+importedModule.getName() );
Although convention says you should call it Module instead of module :).