I am not 100% sure if this will work, because i dont have a test environment with me to help you out.

But, can you instantiate A before executing getFileName() methid and then check if everything...