Java tutorial
//package com.java2s; //License from project: Apache License public class Main { static <T> void validateInterface(Class<T> clientInterface) { if (!clientInterface.isInterface()) { throw new IllegalArgumentException("Monkey, debe ser una interfaz"); } if (clientInterface.getInterfaces().length > 0) { throw new IllegalArgumentException("Monkey, no debe implementar de otra interfaz"); } } }