JobContext { public static JobContext from(final CloudJobConfiguration cloudJobConfig, final ExecutionType type) { int shardingTotalCount = cloudJobConfig.getJobConfig().getShardingTotalCount(); List<Integer> shardingItems = new ArrayList<>(shardingTotalCount); for (int i = 0; i < shardingTotalCount; i++) { shardingItems.add(i); } return new JobContext(cloudJobConfig, shardingItems, type); }  static JobContext from(final CloudJobConfiguration cloudJobConfig, final ExecutionType type);  }
@Test public void assertFrom() { CloudJobConfiguration cloudJobConfig = CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job").toCloudJobConfiguration(); JobContext actual = JobContext.from(cloudJobConfig, ExecutionType.READY); assertThat(actual.getAssignedShardingItems().size(), is(10)); for (int i = 0; i < actual.getAssignedShardingItems().size(); i++) { assertThat(actual.getAssignedShardingItems().get(i), is(i)); } }