simple illustration of loan pattern written in java