We had training related to java, and was short example of code, like that :
[crayon-5bf04b5737761589521569/] and all developers tried to find places where NPE can be thrown. Yes, we found that name can be null
[crayon-5bf04b573776a237944870/] also that agent.getFullName() can throw NPE. But I asked, next question :
[crayon-5bf04b573776e176988728/] So, here is short description how that can be implemented 🙂
OK, we should know where method length() is declared, short investigation can show us that method length() is from interface CharSequence.
[crayon-5bf04b5737772549577555/] The answer we cannot! (Reflection we cannot use for that task)
OK, So, we have full information and can start develop our puzzle with throwing NPE in length() method.
First step is develop String and StringUtils.
What is the advice, try to think out of the scope 🙂 …