public static List<Partition> toPartitions(Collection<NamedPartition> collection){
  List<Partition> partitions=new ArrayList<>();
  for (  NamedPartition pwn : collection) {
    partitions.add(pwn.getPartition());
  }
  return partitions;
}

public static List < Partition > toPartitions ( Collection < NamedPartition > collection ) { List < Partition > partitions = new ArrayList < > ( ) ; for ( NamedPartition pwn : collection ) { partitions . add ( pwn . getPartition ( ) ) ; } return partitions ; }
convert a collection of namedpartitions to a list of partitions .
