test_class.file: library/src/test/java/com/github/devnied/emvnfccard/utils/TrackUtilsTest.java
test_class.identifier: TrackUtilsTest
test_case.body: @Test
  	public void track1Test() {
  		EmvTrack1 track1 = TrackUtils
  				.extractTrack1Data(
  						BytesUtils
  								.fromString("42343131313131313131313131313131313F305E202F5E31373032323031313030333F313030313030303030303030303030303F"));
  
  		Assertions.assertThat(track1).isNotNull();
  		Assertions.assertThat(track1.getCardNumber()).isEqualTo("4111111111111111");
  		SimpleDateFormat sdf = new SimpleDateFormat("MM/yyyy");
  		Assertions.assertThat(sdf.format(track1.getExpireDate())).isEqualTo("02/2017");
  		Assertions.assertThat(track1).isNotNull();
  		Assertions.assertThat(track1.getService()).isNotNull();
  		Assertions.assertThat(track1.getService().getServiceCode1()).isEqualTo(ServiceCode1Enum.INTERNATIONNAL_ICC);
  		Assertions.assertThat(track1.getService().getServiceCode1().getInterchange()).isNotNull();
  		Assertions.assertThat(track1.getService().getServiceCode1().getTechnology()).isNotNull();
  		Assertions.assertThat(track1.getService().getServiceCode2()).isEqualTo(ServiceCode2Enum.NORMAL);
  		Assertions.assertThat(track1.getService().getServiceCode2().getAuthorizationProcessing()).isNotNull();
  		Assertions.assertThat(track1.getService().getServiceCode3()).isEqualTo(ServiceCode3Enum.NO_RESTRICTION);
  		Assertions.assertThat(track1.getService().getServiceCode3().getAllowedServices()).isNotNull();
  		Assertions.assertThat(track1.getService().getServiceCode3().getPinRequirements()).isNotNull();
  	}
test_case.class_method_signature: TrackUtilsTest.track1Test()
test_case.full_signature: @Test public void track1Test()
test_case.identifier: track1Test
test_case.invocations: extractTrack1Data fromString isNotNull assertThat isEqualTo assertThat getCardNumber isEqualTo assertThat format getExpireDate isNotNull assertThat isNotNull assertThat getService isEqualTo assertThat getServiceCode1 getService isNotNull assertThat getInterchange getServiceCode1 getService isNotNull assertThat getTechnology getServiceCode1 getService isEqualTo assertThat getServiceCode2 getService isNotNull assertThat getAuthorizationProcessing getServiceCode2 getService isEqualTo assertThat getServiceCode3 getService isNotNull assertThat getAllowedServices getServiceCode3 getService isNotNull assertThat getPinRequirements getServiceCode3 getService
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void track1Test()
focal_class.declarator: LOGGER = LoggerFactory.getLogger(TrackUtils.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(TrackUtils.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: CARD_HOLDER_NAME_SEPARATOR = "/"
focal_class.modifier: public static final
focal_class.original_string: public static final String CARD_HOLDER_NAME_SEPARATOR = "/";
focal_class.type: String
focal_class.var_name: CARD_HOLDER_NAME_SEPARATOR
focal_class.declarator: TRACK2_EQUIVALENT_PATTERN = Pattern.compile("([0-9]{1,19})D([0-9]{4})([0-9]{3})?(.*)")
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern TRACK2_EQUIVALENT_PATTERN = Pattern.compile("([0-9]{1,19})D([0-9]{4})([0-9]{3})?(.*)");
focal_class.type: Pattern
focal_class.var_name: TRACK2_EQUIVALENT_PATTERN
focal_class.declarator: TRACK1_PATTERN = Pattern
  			.compile("%?([A-Z])([0-9]{1,19})(\\?[0-9])?\\^([^\\^]{2,26})\\^([0-9]{4}|\\^)([0-9]{3}|\\^)([^\\?]+)\\??")
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern TRACK1_PATTERN = Pattern
  			.compile("%?([A-Z])([0-9]{1,19})(\\?[0-9])?\\^([^\\^]{2,26})\\^([0-9]{4}|\\^)([0-9]{3}|\\^)([^\\?]+)\\??");
focal_class.type: Pattern
focal_class.var_name: TRACK1_PATTERN
focal_class.file: library/src/main/java/com/github/devnied/emvnfccard/utils/TrackUtils.java
focal_class.identifier: TrackUtils
focal_class.class_method_signature: TrackUtils.extractTrack2EquivalentData(final byte[] pRawTrack2)
focal_class.full_signature: public static EmvTrack2 extractTrack2EquivalentData(final byte[] pRawTrack2)
focal_class.identifier: extractTrack2EquivalentData
focal_class.modifiers: public static
focal_class.parameters: (final byte[] pRawTrack2)
focal_class.return: EmvTrack2
focal_class.signature: EmvTrack2 extractTrack2EquivalentData(final byte[] pRawTrack2)
focal_class.class_method_signature: TrackUtils.extractTrack1Data(final byte[] pRawTrack1)
focal_class.full_signature: public static EmvTrack1 extractTrack1Data(final byte[] pRawTrack1)
focal_class.identifier: extractTrack1Data
focal_class.modifiers: public static
focal_class.parameters: (final byte[] pRawTrack1)
focal_class.return: EmvTrack1
focal_class.signature: EmvTrack1 extractTrack1Data(final byte[] pRawTrack1)
focal_class.class_method_signature: TrackUtils.TrackUtils()
focal_class.full_signature: private  TrackUtils()
focal_class.identifier: TrackUtils
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  TrackUtils()
focal_method.body: public static EmvTrack1 extractTrack1Data(final byte[] pRawTrack1) {
  		EmvTrack1 ret = null;
  
  		if (pRawTrack1 != null) {
  			EmvTrack1 track1 = new EmvTrack1();
  			track1.setRaw(pRawTrack1);
  			Matcher m = TRACK1_PATTERN.matcher(new String(pRawTrack1));
  			// Check pattern
  			if (m.find()) {
  				// Set format code
  				track1.setFormatCode(m.group(1));
  				// Set card number
  				track1.setCardNumber(m.group(2));
  				// Extract holder name
  				String[] name = StringUtils.split(m.group(4).trim(), CARD_HOLDER_NAME_SEPARATOR);
  				if (name != null && name.length == 2) {
  					track1.setHolderLastname(StringUtils.trimToNull(name[0]));
  					track1.setHolderFirstname(StringUtils.trimToNull(name[1]));
  				}
  				// Read expire date
  				SimpleDateFormat sdf = new SimpleDateFormat("yyMM", Locale.getDefault());
  				try {
  					track1.setExpireDate(DateUtils.truncate(sdf.parse(m.group(5)), Calendar.MONTH));
  				} catch (ParseException e) {
  					LOGGER.error("Unparsable expire card date : {}", e.getMessage());
  					return ret;
  				}
  				// Read service
  				track1.setService(new Service(m.group(6)));
  				ret = track1;
  			}
  		}
  		return ret;
  	}
focal_method.class_method_signature: TrackUtils.extractTrack1Data(final byte[] pRawTrack1)
focal_method.full_signature: public static EmvTrack1 extractTrack1Data(final byte[] pRawTrack1)
focal_method.identifier: extractTrack1Data
focal_method.invocations: setRaw matcher find setFormatCode group setCardNumber group split trim group setHolderLastname trimToNull setHolderFirstname trimToNull getDefault setExpireDate truncate parse group error getMessage setService group
focal_method.modifiers: public static
focal_method.parameters: (final byte[] pRawTrack1)
focal_method.return: EmvTrack1
focal_method.signature: EmvTrack1 extractTrack1Data(final byte[] pRawTrack1)