### Question:
XmlSchemasPresenter implements Presenter, SettingsAware { @Override public void onUpdate(final Settings settings) { if (settings == null) { throw new IllegalArgumentException("Settings must not be null."); } settings.setXmlSchemas(schemaDTOs.toArray(new XmlSchemaDTO[]{})); schemaResolver.refresh(); } XmlSchemasPresenter(final XmlSchemasView view); @Override void registerSchema(final XmlSchemaDTO schema); @Override void unregisterSchema(final XmlSchemaDTO schema); @Override void onLoad(final Settings settings); @Override void onUpdate(final Settings settings);  }### Answer:
@Test(expectedExceptions=IllegalArgumentException.class) public void testOnUpdateIfNullSettings() { presenter.onUpdate(null); }
@Test public void testOnUpdate() { final Settings mockSettings = new MockSettings(); mockSchemaResolver.refresh(); expectLastCall(); EasyMockUnitils.replay(); presenter.onUpdate(mockSettings); final XmlSchemaDTO[] schemas = mockSettings.getXmlSchemas(); assertNotNull("Returned schema array is null.", schemas); assertEquals("Incorrect size of schema array", 1, schemas.length); assertEquals("Unexpected location of the schema.", SAMPLE_LOCATION, schemas[0].getLocation()); }