@Test public void separateDateStringParts_withPartialDate_properlySeparatesString() { String[] parts = DateUtils.separateDateStringParts("123"); String[] expected = {"12", "3"}; assertArrayEquals(expected, parts); }
@Size(2) @NonNull static String[] separateDateStringParts(@NonNull @Size(max = 4) String expiryInput) { String[] parts = new String[2]; if (expiryInput.length() >= 2) { parts[0] = expiryInput.substring(0, 2); parts[1] = expiryInput.substring(2); } else { parts[0] = expiryInput; parts[1] = ""; } return parts; }
DateUtils { @Size(2) @NonNull static String[] separateDateStringParts(@NonNull @Size(max = 4) String expiryInput) { String[] parts = new String[2]; if (expiryInput.length() >= 2) { parts[0] = expiryInput.substring(0, 2); parts[1] = expiryInput.substring(2); } else { parts[0] = expiryInput; parts[1] = ""; } return parts; } }
DateUtils { @Size(2) @NonNull static String[] separateDateStringParts(@NonNull @Size(max = 4) String expiryInput) { String[] parts = new String[2]; if (expiryInput.length() >= 2) { parts[0] = expiryInput.substring(0, 2); parts[1] = expiryInput.substring(2); } else { parts[0] = expiryInput; parts[1] = ""; } return parts; }  }
DateUtils { @Size(2) @NonNull static String[] separateDateStringParts(@NonNull @Size(max = 4) String expiryInput) { String[] parts = new String[2]; if (expiryInput.length() >= 2) { parts[0] = expiryInput.substring(0, 2); parts[1] = expiryInput.substring(2); } else { parts[0] = expiryInput; parts[1] = ""; } return parts; }   }
DateUtils { @Size(2) @NonNull static String[] separateDateStringParts(@NonNull @Size(max = 4) String expiryInput) { String[] parts = new String[2]; if (expiryInput.length() >= 2) { parts[0] = expiryInput.substring(0, 2); parts[1] = expiryInput.substring(2); } else { parts[0] = expiryInput; parts[1] = ""; } return parts; }    }