Scala learning note and helper function and tool here.