import java.time.Period;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class Main {
	public static void main(String[] args) {
		String[] arr = { "1 years, 2 months, 22 days", "1 years, 1 months, 14 days", "4 years, 24 days",
				"13 years, 21 days", "9 months, 1 day" };

		List<Period> periodList = 
				Arrays.stream(arr)
					.map(s -> Period.parse( 
								"P" + s.replaceAll("[\\s+,]", "")
										.replaceAll("years?","Y")
										.replaceAll("months?", "M")
										.replaceAll("days?", "D")
							)
					)
					.collect(Collectors.toList());
		
		System.out.println(periodList);
		
		// Now you can retrieve year,  month and day from the Period e.g.
		periodList.forEach(p -> 
			System.out.println(
					p + " => " + 
					p.getYears() + " years " + 
					p.getMonths() + " months "+ 
					p.getDays() +" days"
			)
		);
	}
}