### Question:
JPAEdmFunctionImport extends JPAEdmBaseViewImpl implements JPAEdmFunctionImportView { @Override public JPAEdmBuilder getBuilder() { if (builder == null) { builder = new JPAEdmFunctionImportBuilder(); } return builder; } JPAEdmFunctionImport(final JPAEdmSchemaView view); @Override JPAEdmBuilder getBuilder(); @Override List<FunctionImport> getConsistentFunctionImportList();  }### Answer:
@Test public void testNoEntitySet() { VARIANT = 5; try { jpaEdmfunctionImport.getBuilder().build(); fail("Exception Expected"); } catch (ODataJPAModelException e) { assertEquals(ODataJPAModelException.FUNC_RETURN_TYPE_ENTITY_NOT_FOUND.getKey(), e.getMessageReference().getKey()); } catch (ODataJPARuntimeException e) { fail("Model Exception Expected"); } }
@Test public void testNoReturnTypeButAnnotated() { VARIANT = 6; try { jpaEdmfunctionImport.getBuilder().build(); fail("Exception Expected"); } catch (ODataJPAModelException e) { assertEquals(ODataJPAModelException.FUNC_RETURN_TYPE_EXP.getKey(), e.getMessageReference().getKey()); } catch (ODataJPARuntimeException e) { fail("Model Exception Expected"); } }
@Test public void testFunctionImportEntityTypeInvalid() { VARIANT = 8; try { jpaEdmfunctionImport.getBuilder().build(); fail("Exception Expected"); } catch (ODataJPAModelException e) { assertEquals(ODataJPAModelException.TYPE_NOT_SUPPORTED.getKey(), e.getMessageReference().getKey()); } catch (ODataJPARuntimeException e) { fail("Model Exception Expected"); } }
@Test public void testFunctionImportComplexTypeInvalid() { VARIANT = 11; try { jpaEdmfunctionImport.getBuilder().build(); fail("Exception Expected"); } catch (ODataJPAModelException e) { assertEquals(ODataJPAModelException.FUNC_RETURN_TYPE_ENTITY_NOT_FOUND.getKey(), e.getMessageReference().getKey()); } catch (ODataJPARuntimeException e) { fail("Model Exception Expected"); } }
@Test public void testFunctionImportScalarTypeInvalid() { VARIANT = 12; try { jpaEdmfunctionImport.getBuilder().build(); fail("Exception Expected"); } catch (ODataJPAModelException e) { assertEquals(ODataJPAModelException.TYPE_NOT_SUPPORTED.getKey(), e.getMessageReference().getKey()); } catch (ODataJPARuntimeException e) { fail("Model Exception Expected"); } }
@Test public void testFunctionImportParamNoName() { VARIANT = 13; try { jpaEdmfunctionImport.getBuilder().build(); fail("Exception Expected"); } catch (ODataJPAModelException e) { assertEquals(ODataJPAModelException.FUNC_PARAM_NAME_EXP.getKey(), e.getMessageReference().getKey()); } catch (ODataJPARuntimeException e) { fail("Model Exception Expected"); } }
@Test public void testWrongReturnTypeScalar() { VARIANT = 16; try { jpaEdmfunctionImport.getBuilder().build(); fail("Exception Expected"); } catch (ODataJPAModelException e) { assertEquals(ODataJPAModelException.FUNC_RETURN_TYPE_EXP.getKey(), e.getMessageReference().getKey()); } catch (ODataJPARuntimeException e) { fail("Model Exception Expected"); } }
@Test public void testWrongReturnTypeComplex() { VARIANT = 17; try { jpaEdmfunctionImport.getBuilder().build(); fail("Exception Expected"); } catch (ODataJPAModelException e) { assertEquals(ODataJPAModelException.FUNC_RETURN_TYPE_EXP.getKey(), e.getMessageReference().getKey()); } catch (ODataJPARuntimeException e) { fail("Model Exception Expected"); } }
@Test public void testGetBuilderIdempotent() { JPAEdmFunctionImport jpaEdmfunctionImport = new JPAEdmFunctionImport(this); JPAEdmBuilder builder1 = jpaEdmfunctionImport.getBuilder(); JPAEdmBuilder builder2 = jpaEdmfunctionImport.getBuilder(); assertEquals(builder1.hashCode(), builder2.hashCode()); }