Typescript Check If Object Is Of Interface In Java