lambdajを使用して、サブリストを1つのリストに結合できるようにしたい。
私は動作する反復バージョンを持っています:
// HDU elements are children of each subsystem
Collection<SpaceSystemType> subsystems = this.getAllSubsystems();
Set<SpaceSystemType> sources = new HashSet<SpaceSystemType>();
// Iterate the subsystems, collecting all the sources
for (SpaceSystemType subsystem : subsystems)
sources.addAll(subsystem.getSpaceSystem()); // getSpaceSystem returns a List<SpaceSystemType>
return sources;
私はこれができるようになりたいです:
extract(subsystems, on(SpaceSystemType.class).getSpaceSystem());
しかし、extractは
List<List<SpaceSystemType>>
だから私は間違ったコマンドを使用しているに違いありません。
どのlambdajコマンドが私が望むものを達成しますか?