question: 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 ; }
target:  Returns a map of unit -> transport. Unit must already be loaded in the transport.