Is it possible to have a method return different types based on conditions? Never learned Java extensively but I researched generics and it doesn\'t seem to apply if the dep