private String getListBy( String variable ) {
        StringBuilder sb = new StringBuilder();
        if ( hasSearch ) {
            for ( int i = 1; i < searchList.size() + 1; i++ ) {

                sb.append( "\n" + TAB + TAB + TAB + "List<" + variable + "> list" + i + "= " );
                sb.append( toJavaCase( variable ) + "Dao.getListBy" + toTitleCase( searchList.get( i - 1 ) ) );
                sb.append( "( " + toJavaCase( variable ) + ".get" + toTitleCase( searchList.get( i - 1 ) ) );
                sb.append( "() ) ; \n" );

                sb.append( TAB + TAB + TAB + "assertEquals( 1, list" + i + ".size() );\n" );

                sb.append( TAB + TAB + TAB + "compareRecords( " + toJavaCase( variable ) );
                sb.append( ", list" + i + ".get( 0 ) );\n" );
            }
        }
        return sb.toString();
    }