Typescript Check If Variable Is Of Interface In Java