public static int findInfractionCount(EntityManager em,PrincipalUser user,SubSystem subSystem,long startTime){
  List<SuspensionRecord> records;
  if (subSystem == null) {
    records=findByUser(em,user);
  }
 else {
    SuspensionRecord record=findByUserAndSubsystem(em,user,subSystem);
    records=record == null ? new ArrayList<SuspensionRecord>(0) : Arrays.asList(new SuspensionRecord[]{record});
  }
  int count=0;
  for (  SuspensionRecord record : records) {
    List<Long> timestamps=record.getInfractionHistory();
    for (    Long timestamp : timestamps) {
      if (timestamp > startTime) {
        count++;
      }
    }
  }
  return count;
}

public static int findInfractionCount ( EntityManager em , PrincipalUser user , SubSystem subSystem , long startTime ) { List < SuspensionRecord > records ; if ( subSystem == null ) { records = findByUser ( em , user ) ; } else { SuspensionRecord record = findByUserAndSubsystem ( em , user , subSystem ) ; records = record == null ? new ArrayList < SuspensionRecord > ( 0 ) : Arrays . asList ( new SuspensionRecord [ ] { record } ) ; } int count = 0 ; for ( SuspensionRecord record : records ) { List < Long > timestamps = record . getInfractionHistory ( ) ; for ( Long timestamp : timestamps ) { if ( timestamp > startTime ) { count ++ ; } } } return count ; }
finds the number of user infractions for a subsystem that have occurred since the given start time .
