WinderStepRegistry implements StepRegistry { @Override public Step lookup(Class<? extends Step> clazz, final int code) { JobMetadata metadata = getMetadata(clazz); if (metadata == null) { throw new IllegalArgumentException("No such job:" + clazz); } return metadata.getStep(code).toStep(); }  @Override Step lookup(Class<? extends Step> clazz, final int code); @Override JobMetadata register(Class<? extends Step> e); @Override JobMetadata getMetadata(Class<? extends Step> clazz);  }
@Test public void lookup() throws Exception { WinderStepRegistry registry = new WinderStepRegistry(); registry.register(SimpleJob.class); assertEquals(registry.lookup(SimpleJob.class, 10).code(), 10); assertEquals(registry.lookup(SimpleJob.class, 20).code(), 20); }