Buggy code:
public class Utils { public static final int CATEGORYPATH_FIELD_COUNT = 2 ; public static final float DEFAUL_CATEGORYPATH_WEIGHT = 1.0F ; public static AnalyticsDataService getAnalyticsDataService ( ) throws AnalyticsException { } public static AnalyticsDataAPI getAnalyticsDataAPIs ( ) throws AnalyticsException { } public static SecureAnalyticsDataService getCarbonAnalyticsAPI ( ) throws AnalyticsException { } public static List < Record > getRecords ( String username , List < RecordBean > recordBeans ) throws AnalyticsException { } @ SuppressWarnings ( "unchecked" ) private static Map < String , Object > validateAndReturn ( Map < String , Object > values ) throws AnalyticsIndexException { } public static List < Record > getRecordsForTable ( String username , String tableName , List < RecordBean > recordBeans ) throws AnalyticsException { List < Record > records = new ArrayList < > ( ) ; for ( RecordBean recordBean : recordBeans ) { <START_BUG> records . add ( new Record ( Utils . getTenantId ( username ) , tableName , Utils . validateAndReturn ( recordBean . getValues ( ) ) ) ) ; <END_BUG> } return records ; } public static List < RecordBean > createRecordBeans ( List < Record > records ) { } public static RecordBean createRecordBean ( Record record ) { } public static IndexTypeBean createIndexTypeBean ( IndexType indexType ) { } public static IndexType createIndexType ( IndexTypeBean indexTypeBean ) { } public static Map < String , IndexTypeBean > createIndexTypeBeanMap ( Map < String , IndexType > indexTypeMap ) { } public static Map < String , IndexType > createIndexTypeMap ( Map < String , IndexTypeBean > indexTypeBeanMap ) { } public static List < String > getRecordIds ( List < SearchResultEntry > searchResults ) { } public static String getCompleteErrorMessage ( String msg , Exception e ) { } public static List < Iterator < Record > > getRecordIterators ( RecordGroup [ ] recordGroups , SecureAnalyticsDataService analyticsDataService ) throws AnalyticsException { } public static AnalyticsSchema createAnalyticsSchema ( AnalyticsSchemaBean analyticsSchemaBean ) { } public static AnalyticsSchemaBean createTableSchemaBean ( AnalyticsSchema analyticsSchema ) { } public static DrillDownResultBean createDrillDownResultBean ( Map < String , List < DrillDownResultEntry > > result ) { } private static Map < String , DrillDownPerFieldResultBean > createPerFieldDrillDownResultBean ( Map < String , List < DrillDownResultEntry > > result ) { } private static Map < String , DrillDownResultEntryBean > createPerCategoryDrillDownResultBean ( List < DrillDownResultEntry > result ) { } public static RangeDrillDownResultBean createRangeDrillDownResultBean ( Map < String , List < DrillDownResultEntry > > result ) { } private static List < PerRangeDrillDownResultBean > createPerRangeDrillDownResultBeans ( List < DrillDownResultEntry > value ) { } public static AnalyticsDrillDownRequest createDrilldownRequest ( DrillDownRequestBean bean ) { } private static Map < String , List < AnalyticsDrillDownRange > > createDrillDownRanges ( Map < String , List < DrillDownRangeBean > > ranges ) { } private static List < AnalyticsDrillDownRange > createDrillDownRanges ( List < DrillDownRangeBean > ranges ) { } private static Map < String , AnalyticsCategoryPath > createCategoryPaths ( List < DrillDownPathBean > bean ) { } private static ColumnType getColumnType ( ColumnTypeBean columnTypeBean ) { } private static ColumnTypeBean getColumnTypeBean ( AnalyticsSchema . ColumnType columnType ) { } private static int getTenantId ( String username ) throws AnalyticsException { } }

Fix:
records . add ( new Record ( recordBean . getId ( ) , Utils . getTenantId ( username ) , tableName , Utils . validateAndReturn ( recordBean . getValues ( ) ) ) ) ;