code: private static void filterClassesAddedToDeployedUnit( DeployedUnit deployedUnit, Class classToAdd) {
  
          if( classToAdd.isInterface()
                  || classToAdd.isAnnotation()
                  || classToAdd.isLocalClass()
                  || classToAdd.isMemberClass() ) {
             return;
          }
  
          boolean jaxbClass = false;
          boolean remoteableClass = false;
          // @XmlRootElement and @XmlType may be used with inheritance
          for( Annotation anno : classToAdd.getAnnotations() ) {
             if( XmlRootElement.class.equals(anno.annotationType()) ) {
                jaxbClass = true;
                break;
             }
             if( XmlType.class.equals(anno.annotationType()) ) {
                jaxbClass = true;
                break;
             }
          }
          // @Remotable is not inheritable, and may not be used as such
          for( Annotation anno : classToAdd.getDeclaredAnnotations() ) {
             if( Remotable.class.equals(anno.annotationType()) ) {
                 remoteableClass = true;
                 break;
             }
          }
  
          if( jaxbClass || remoteableClass ) {
              DeployedUnitImpl deployedUnitImpl = (DeployedUnitImpl) deployedUnit;
              deployedUnitImpl.addClass(classToAdd);
          }
      }
docs: This method is used to filter classes that are added to the {@link DeployedUnit}.
  </p>
  When this method is used, only classes that are meant to be used with serialization are
  added to the deployment. This feature can be used to, for example, make sure that non-serialization-compatible
  classes (such as interfaces), do not complicate the use of a deployment with the remote services (REST/JMS/WS).
  </p>
  Note to other developers, it's possible that classpath problems may arise, because
  of either classloader or lazy class resolution problems: I simply don't know enough about the
  inner workings of the JAXB implementations (plural!) to figure this out.
  
  @param deployedUnit The {@link DeployedUnit} to which the classes are added. The {@link DeployedUnit} to which the classes are added. The {@link DeployedUnit} to which the classes are added.
  @param classToAdd The class to add to the {@link DeployedUnit}.