### Question:
JPQLJoinStatementBuilder extends JPQLStatementBuilder { @Override public JPQLStatement build() throws ODataJPARuntimeException { jpqlStatement = createStatement(createJPQLQuery()); this.context.setJPQLStatement(jpqlStatement.toString()); return jpqlStatement; } JPQLJoinStatementBuilder(final JPQLContextView context); @Override JPQLStatement build();  }### Answer:
@Test public void testBuild() throws Exception { setUp(getJoinClauseList()); JPQLJoinStatementBuilder jpqlJoinStatementBuilder = new JPQLJoinStatementBuilder(context); try { JPQLStatement jpqlStatement = jpqlJoinStatementBuilder.build(); assertEquals( "SELECT mat FROM SOHeader soh JOIN soh.soItem soi JOIN soi.material mat WHERE soh.buyerId = 2 AND " + "soh.createdBy = 'Peter' AND soi.shId = soh.soId AND mat.id = 'abc' " + "ORDER BY mat.buyerId asc , mat.city desc", jpqlStatement.toString()); } catch (ODataJPARuntimeException e) { fail("Should not have come here"); } }
@Test public void testJoinClauseAsNull() throws Exception { setUp(null); JPQLJoinStatementBuilder jpqlJoinStatementBuilder = new JPQLJoinStatementBuilder(context); try { jpqlJoinStatementBuilder.build(); fail("Should not have come here"); } catch (ODataJPARuntimeException e) { assertTrue(true); } }
@Test public void testJoinClauseListAsEmpty() throws Exception { setUp(new ArrayList<JPAJoinClause>()); JPQLJoinStatementBuilder jpqlJoinStatementBuilder = new JPQLJoinStatementBuilder(context); try { jpqlJoinStatementBuilder.build(); fail("Should not have come here"); } catch (ODataJPARuntimeException e) { assertTrue(true); } }