### Question:
ScalarInParameter implements InParameter<BASIC> { @Override public Optional<Class<?>> getDomainClass() { return scalar.getDomainClass(); } ScalarInParameter(Scalar<BASIC, CONTAINER> holder);  ScalarInParameter(Scalar<BASIC, CONTAINER> holder, CONTAINER value); @Override CONTAINER getValue(); @Override Wrapper<BASIC> getWrapper(); @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(); ScalarInParameter<String, PhoneNumber> parameter = new ScalarInParameter<>(scalar); 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(); ScalarInParameter<String, Optional<PhoneNumber>> parameter = new ScalarInParameter<>(scalar); Optional<Class<?>> optional = parameter.getDomainClass(); assertEquals(PhoneNumber.class, optional.get()); }