public class Solution {

    public static void main(String[] args) {

    }

    public static class PersonScannerAdapter implements PersonScanner {

        private Scanner fileScanner;

        public PersonScannerAdapter(Scanner fileScanner){
            this.fileScanner=fileScanner;
        }

        @Override
        public Person read() throws IOException, ParseException {

            //Иванов Иван Иванович 31 12 1950


            BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream("file.txt")));
            String s1 = br.readLine();
            br.close();

            String[] s = s1.split(" ",4);
            SimpleDateFormat format = new SimpleDateFormat("dd MM yyyy", Locale.ENGLISH);
            Date d = format.parse(s[3]);

            return new Person(s[1],  s[2], s[0], d );
        }

        @Override
        public void close() throws IOException {
            fileScanner.close();
        }
    }
}