code: private Class[] getInterfaces(Class clazz) {
          Class superClazz = clazz;
          Class[] interfaces = clazz.getInterfaces();
  
          // clazz can be an interface itself and when getInterfaces()
          // is called on an interface it returns only the extending
          // interfaces, not the interface itself.
          if (clazz.isInterface()) {
              Class[] tempInterfaces = new Class[interfaces.length + 1];
              tempInterfaces[0] = clazz;
  
              System.arraycopy(interfaces, 0, tempInterfaces, 1, interfaces.length);
              interfaces = tempInterfaces;
          }
  
          // add all interfaces implemented by superclasses to the interfaces array
          while ((superClazz = superClazz.getSuperclass()) != null) {
              Class[] superInterfaces = superClazz.getInterfaces();
              Class[] combInterfaces = new Class[interfaces.length + superInterfaces.length];
              System.arraycopy(interfaces, 0, combInterfaces, 0, interfaces.length);
              System.arraycopy(superInterfaces, 0, combInterfaces, interfaces.length, superInterfaces.length);
              interfaces = combInterfaces;
          }
  
          /**
           * Must remove duplicate interfaces before calling Proxy.getProxyClass().
           * Duplicates can occur if a subclass re-declares that it implements
           * the same interface as one of its ancestor classes.
           **/
          HashMap unique = new HashMap();
          for (int i = 0; i < interfaces.length; i++) {
              unique.put(interfaces[i].getName(), interfaces[i]);
          }
          /* Add the OJBProxy interface as well */
          unique.put(OJBProxy.class.getName(), OJBProxy.class);
  
          interfaces = (Class[])unique.values().toArray(new Class[unique.size()]);
  
          return interfaces;
      }
docs: Get interfaces implemented by clazz
  
  @param clazz
  @return