public static List<VolumeDescriptor> filterByType(List<VolumeDescriptor> descriptors,Type[] inclusive,Type[] exclusive){
  List<VolumeDescriptor> result=new ArrayList<VolumeDescriptor>();
  if (descriptors == null) {
    return result;
  }
  HashSet<Type> included=new HashSet<Type>();
  if (inclusive != null) {
    included.addAll(Arrays.asList(inclusive));
  }
  HashSet<Type> excluded=new HashSet<Type>();
  if (exclusive != null) {
    excluded.addAll(Arrays.asList(exclusive));
  }
  for (  VolumeDescriptor desc : descriptors) {
    if (excluded.contains(desc.getType())) {
      continue;
    }
    if (included.isEmpty() || included.contains(desc.getType())) {
      result.add(desc);
    }
  }
  return result;
}

public static List < VolumeDescriptor > filterByType ( List < VolumeDescriptor > descriptors , Type [ ] inclusive , Type [ ] exclusive ) { List < VolumeDescriptor > result = new ArrayList < VolumeDescriptor > ( ) ; if ( descriptors == null ) { return result ; } HashSet < Type > included = new HashSet < Type > ( ) ; if ( inclusive != null ) { included . addAll ( Arrays . asList ( inclusive ) ) ; } HashSet < Type > excluded = new HashSet < Type > ( ) ; if ( exclusive != null ) { excluded . addAll ( Arrays . asList ( exclusive ) ) ; } for ( VolumeDescriptor desc : descriptors ) { if ( excluded . contains ( desc . getType ( ) ) ) { continue ; } if ( included . isEmpty ( ) || included . contains ( desc . getType ( ) ) ) { result . add ( desc ) ; } } return result ; }
filter a list of volumedescriptors by type ( s ) .
