Added a 'read' method expecting the POJO as input instead than a list of lines.