### Question:
InitializerState extends SessionEntity { public int getSegmentsCount() { return segmentsCount; } InitializerState(int segmentsCount); private  InitializerState(String realmId, int segmentsCount, BitSet segments); int getSegmentsCount(); boolean isFinished(); List<Integer> getSegmentsToLoad(int segmentToLoad, int maxSegmentCount); void markSegmentFinished(int index); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }### Answer:
@Test public void testOfflineLoaderContext() { OfflinePersistentLoaderContext ctx = new OfflinePersistentLoaderContext(28, 5); Assert.assertEquals(ctx.getSegmentsCount(), 6); ctx = new OfflinePersistentLoaderContext(19, 5); Assert.assertEquals(ctx.getSegmentsCount(), 4); ctx = new OfflinePersistentLoaderContext(20, 5); Assert.assertEquals(ctx.getSegmentsCount(), 4); ctx = new OfflinePersistentLoaderContext(21, 5); Assert.assertEquals(ctx.getSegmentsCount(), 5); }