public static Map<Unit,Unit> mapTransportsAlreadyLoaded(final Collection<Unit> units,final Collection<Unit> transports){
  final Collection<Unit> canBeTransported=Match.getMatches(units,Matches.UnitCanBeTransported);
  final Collection<Unit> canTransport=Match.getMatches(transports,Matches.UnitCanTransport);
  final Map<Unit,Unit> mapping=new HashMap<>();
  for (  final Unit currentTransported : canBeTransported) {
    final Unit transport=TransportTracker.transportedBy(currentTransported);
    if (transport == null || !canTransport.contains(transport)) {
      continue;
    }
    mapping.put(currentTransported,transport);
  }
  return mapping;
}

public static Map < Unit , Unit > mapTransportsAlreadyLoaded ( final Collection < Unit > units , final Collection < Unit > transports ) { final Collection < Unit > canBeTransported = Match . getMatches ( units , Matches . UnitCanBeTransported ) ; final Collection < Unit > canTransport = Match . getMatches ( transports , Matches . UnitCanTransport ) ; final Map < Unit , Unit > mapping = new HashMap < > ( ) ; for ( final Unit currentTransported : canBeTransported ) { final Unit transport = TransportTracker . transportedBy ( currentTransported ) ; if ( transport == null || ! canTransport . contains ( transport ) ) { continue ; } mapping . put ( currentTransported , transport ) ; } return mapping ; }
returns a map of unit - > transport . unit must already be loaded in the transport .
