Adding a method to check if name is present

There is no way to add a test for this case because we can't create a mock for classes inside reflect package.