@Test
public void readOpenPeriodsArrayTest() throws IOException {

    when(parser.readOpenPeriodsArray(reader)).thenCallRealMethod();
    when(reader.hasNext()).thenReturn(true, true, true, true, false, true, false, false);
    when(reader.nextName()).thenReturn("open", "close", "skip");
    when(parser.readDateTimePair(reader)).thenReturn(new DateTimePair("one", "two"), new DateTimePair("three", "four"));
    List<OpenPeriod> expected = Arrays.asList(new OpenPeriod(new DateTimePair("one", "two"), new DateTimePair("three", "four")), new OpenPeriod(null, null));
    List<OpenPeriod> actual = parser.readOpenPeriodsArray(reader);
    assertEquals(expected, actual);
}