### Question:
IndexMetadata { public Period getRetentionPeriod() { return retentionPeriod; } @JsonCreator  IndexMetadata(
            @JsonProperty("indexName") String indexName,
            @JsonProperty("indexNamePattern") String indexNamePattern,
            @JsonProperty("retentionType") String retentionType,
            @JsonProperty("retentionPeriod") String retentionPeriod,
            @JsonProperty("preCreate") Boolean preCreate); @Override String toString(); String getIndexNamePattern(); Period getRetentionPeriod(); IIndexNameFilter getIndexNameFilter(); boolean isPreCreate(); boolean isActionable(); DateTime getPastRetentionCutoffDate(DateTime currentDateTime); DateTime getDateForIndexName(String name); String getIndexNameToPreCreate(DateTime currentDateTime);  }### Answer:
@Test public void testFiveMinuteRetention() throws IOException { List<IndexMetadata> indexMetadataList = IndexUtils.parseIndexMetadata( "[{\"indexNamePattern\": \"'nf_errors_log'YYYY\",\"retentionPeriod\":\"PT5M\"}]"); IndexMetadata indexMetadata = indexMetadataList.get(0); assertEquals(Period.minutes(5), indexMetadata.getRetentionPeriod()); }
@Test public void testOneHourRetention() throws IOException { List<IndexMetadata> indexMetadataList = IndexUtils.parseIndexMetadata( "[{\"indexNamePattern\": \"'nf_errors_log'YYYY\",\"retentionPeriod\":\"PT1H\"}]"); IndexMetadata indexMetadata = indexMetadataList.get(0); assertEquals(Period.hours(1), indexMetadata.getRetentionPeriod()); }
@Test public void test18MonthRetention() throws IOException { List<IndexMetadata> indexMetadataList = IndexUtils.parseIndexMetadata( "[{\"indexNamePattern\": \"'nf_errors_log'YYYY\",\"retentionPeriod\":\"P18M\"}]"); IndexMetadata indexMetadata = indexMetadataList.get(0); assertEquals(Period.months(18), indexMetadata.getRetentionPeriod()); }