package Ġvor ot il enko . trend analyzer . fragments . observed symbols Ċ Ċ import Ġandroidx . lifecycle . ViewModel Ċ import Ġandroidx . lifecycle . ViewModel Provider Ċ import Ġvor ot il enko . trend analyzer . view model . App ViewModel Ċ Ċ class ĠOb served Symbols VM Factory ( private Ġval Ġapp ViewModel : ĠApp ViewModel ) Ġ: ĠViewModel Provider . Factory Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġ< T Ġ: ĠViewModel ?> Ġcreate ( model Class : ĠClass < T >): ĠT Ġ{ ĊĠĠĠĠĠĠĠ Ġif Ġ( model Class . isAssignableFrom ( Ob served Symbols ViewModel :: class . java )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn ĠOb served Symbols ViewModel ( app ViewModel ) Ġas ĠT ĊĠĠĠĠĠĠĠ Ġthrow ĠIllegalArgumentException (" Unknown ĠViewModel Ġclass ") ĊĠĠĠ Ġ} Ċ }