public static < T extends Proposition > Map < String , List < T > > createPropositionMap ( List < T > propositions ) { Map < String , List < T > > result = new HashMap <> ( ) ; if ( propositions != null ) { for ( T prop : propositions ) { String propId = prop . getId ( ) ; List < T > ts = null ; if ( result . containsKey ( propId ) ) { ts = result . get ( propId ) ; } else { ts = new ArrayList <> ( ) ; result . put ( propId , ts ) ; } ts . add ( prop ) ; } } return result ; }
Divides a list of propositions up by id .