Convert a Python function to Java anonymous class | Hacker News Reader