protected AbstractTypedFilter(
      final Collection<RelationshipType> types,
      final Collection<RelationshipType> descendantTypes,
      final boolean includeManagedInfo,
      final boolean includeConcreteInfo) {
    if (types == null || types.isEmpty()) {
      this.types =
          Collections.unmodifiableSet(
              new HashSet<RelationshipType>(Arrays.asList(RelationshipType.values())));
    } else {
      this.types = Collections.unmodifiableSet(new HashSet<RelationshipType>(types));
    }

    if (descendantTypes == null || descendantTypes.isEmpty()) {
      this.descendantTypes =
          Collections.unmodifiableSet(
              new HashSet<RelationshipType>(Arrays.asList(RelationshipType.values())));
    } else {
      this.descendantTypes =
          Collections.unmodifiableSet(new HashSet<RelationshipType>(descendantTypes));
    }

    this.includeManagedInfo = includeManagedInfo;
    this.includeConcreteInfo = includeConcreteInfo;
  }
  protected AbstractTypedFilter(
      final RelationshipType type,
      final boolean hasDescendants,
      final boolean includeManagedInfo,
      final boolean includeConcreteInfo) {
    if (type == null) {
      this.types =
          Collections.unmodifiableSet(
              new HashSet<RelationshipType>(Arrays.asList(RelationshipType.values())));
    } else {
      this.types = Collections.unmodifiableSet(Collections.singleton(type));
    }

    if (hasDescendants) {
      this.descendantTypes = types;
    } else {
      this.descendantTypes = Collections.unmodifiableSet(Collections.<RelationshipType>emptySet());
    }

    this.includeManagedInfo = includeManagedInfo;
    this.includeConcreteInfo = includeConcreteInfo;
  }