• I agree it's not very original.
    To make it more challenging, you might replace int with BigInteger and test for bigger numbers.
    Int will become too small very quickly for fibonacci.
    Also the calculation method will become much more important the larger the number is.
    If you use recursion without memoization the processing time will quickly become too slow for codewars.
    And the kata more challenging.

  • This comment is hidden because it contains spoiler information about the solution

  • That's true. I just did not find any simple working version for Java, wanted to practice here at CodeWars.

  • This kata has been done too many times in varying ways. It just isn't original.

  • You are right. Thanks for the catch!

  • IllegalStateException

    Signals that a method has been invoked at an illegal or inappropriate time. In other words, the Java environment or Java application is not in an appropriate state for the requested operation.

    It should probably be IllegalArgumentException.