WDSObject implements IObject, IObjectWrapper { @Override public IObject getEnvironmentIObject(final IFieldName fieldName) throws InvalidArgumentException { if (null == fieldName) { throw new InvalidArgumentException("FieldName should not be null."); } try { return (IObject) this.initIObject.getValue(fieldName); } catch (Throwable e) { throw new InvalidArgumentException("Could not read data from environment with field name " + fieldName, e); } } WDSObject(final IObject wrapperConfig);  WDSObject(final WDSObjectFieldSet fieldSet); @Override Object getValue(final IFieldName name); @Override void setValue(final IFieldName name, final Object value); @Override void deleteField(final IFieldName name); @Override T serialize(); @Override Iterator<Map.Entry<IFieldName, Object>> iterator(); @Override void init(final IObject environment); @Override IObject getEnvironmentIObject(final IFieldName fieldName);  }
@Test (expected = InvalidArgumentException.class) public void checkGetEnvironmentIObjectMehtodExceptionOnNullArgument() throws Exception { IObject wObj = new WDSObject((IObject) null); ((IObjectWrapper) wObj).getEnvironmentIObject(null); fail(); }
@Test (expected = InvalidArgumentException.class) public void checkGetEnvironmentIObjectMehtodExceptionOnWrongArgument() throws Exception { IObject wObj = new WDSObject((IObject) null); ((IObjectWrapper)wObj).getEnvironmentIObject(new FieldName("message")); fail(); }