Java tutorial
//package com.java2s; public class Main { public static <T> void validateScriptInterface(Class<T> service) { if (!service.isInterface()) { throw new IllegalArgumentException("API declarations must be interfaces."); } if (service.getInterfaces().length > 0) { throw new IllegalArgumentException("Script interfaces must not extend other interfaces."); } } }