private boolean implementsInterface(final ClassMetadata other) { if (this == other) { return true; } for (ClassMetadata c = this; c != null; c = c.getSuperclass()) { for (final ClassMetadata in : c.getInterfaces()) { if (in.type.equals(other.type) || in.implementsInterface(other)) { return true; } } } return false; }