@ SuppressWarnings ( "unchecked" ) public static < K , V > AListMap < K , V > empty ( AEquality equality ) { if ( equality == AEquality . EQUALS ) return ( AListMap < K , V > ) emptyEquals ; if ( equality == AEquality . IDENTITY ) return ( AListMap < K , V > ) emptyIdentity ; return new AListMap <> ( equality ) ; }
Returns an empty AListMap instance with a given equalityForEquals . Calling this factory method instead of the constructor allows internal reuse of empty map instances since they are immutable .