ToConverter { public void lock() { toTo.lock(); toDomain.lock(); } ToConverter();  ToConverter(PreConverter preConverter); List<Converter> getToTo(); List<Converter> addToTo(Converter converter); List<Converter> getToDomain(); List<Converter> addToDomain(Converter converter); void lock(); PreConverter getPreConverter();  }
@Test public void lockTest() throws Exception { exception.expect(JTransfoException.class); exception.expectMessage("Collection is read-only."); ToConverter toConverter = new ToConverter(); toConverter.addToDomain(new DummyConverter()); toConverter.lock(); toConverter.addToDomain(new DummyConverter()); }