### Question:
ScalarInOutParameter implements InParameter<BASIC>, OutParameter<BASIC> { @Override public Optional<Class<?>> getDomainClass() { return scalar.getDomainClass(); } ScalarInOutParameter(Scalar<BASIC, CONTAINER> holder, Reference<CONTAINER> reference); @Override CONTAINER getValue(); @Override Wrapper<BASIC> getWrapper(); @Override void updateReference(); @Override Optional<Class<?>> getDomainClass(); @Override R accept(SqlParameterVisitor<R, P, TH> visitor, P p);  }### Answer:
@Test public void testGetDomainClass() { DomainType<String, PhoneNumber> domainType = DomainTypeFactory.getDomainType(PhoneNumber.class, new ClassHelper() {}); Scalar<String, PhoneNumber> scalar = domainType.createScalar(); Reference<PhoneNumber> ref = new Reference<>(); ScalarInOutParameter<String, PhoneNumber> parameter = new ScalarInOutParameter<>(scalar, ref); Optional<Class<?>> optional = parameter.getDomainClass(); assertEquals(PhoneNumber.class, optional.get()); }
@Test public void testGetDomainClass_optional() { DomainType<String, PhoneNumber> domainType = DomainTypeFactory.getDomainType(PhoneNumber.class, new ClassHelper() {}); Scalar<String, Optional<PhoneNumber>> scalar = domainType.createOptionalScalar(); Reference<Optional<PhoneNumber>> ref = new Reference<>(); ScalarInOutParameter<String, Optional<PhoneNumber>> parameter = new ScalarInOutParameter<>(scalar, ref); Optional<Class<?>> optional = parameter.getDomainClass(); assertEquals(PhoneNumber.class, optional.get()); }