private List < Unit > getBases ( Unit unit ) { Map < Unit , UnitFactor > map = factors . get ( unit ) ; if ( map != null ) { return map . values ( ) . stream ( ) . map ( u -> u . unit ( ) ) . collect ( Collectors . toList ( ) ) ; } return Collections . emptyList ( ) ; }
Fetch all of the existing bases for the given unit . A base is a conversion factor that was directly added or the inverse of one that was directly added .