### Question:
AppController extends Application { public String getArtifactId(String type) { return String.format("%s_artifact-%s_%s_%s", Utils.getAndroidID(getContentResolver()), type, Utils.getUniversalTimestamp(), Utils.getSaltString(16)); }  @Override void onCreate(); String getAzureConnection(); boolean isAdmin(); static synchronized AppController getInstance(); String getPersonId(); String getMeasureId(); String getArtifactId(String type); String getArtifactId(String type, long timestamp); String getDeviceId(); File getRootDirectory(); boolean isUploadRunning();  }### Answer:
@Test public void getArtifactId() { String valid = String.format("%s_artifact-%s_%s_%s", "AndroidUUID", "pcd", Utils.getUniversalTimestamp(), Utils.getSaltString(16)); String invalidId = "9e58cfb935e72628_artifact-pcd2_1550288920148_eKtxZ4ZRBdXXIbQL"; String[] array = valid.split("_"); ArrayList<String> types = new ArrayList<>(); types.add("pcd"); types.add("rgb"); Assert.assertEquals("Artifact ID schema is not correct, expect 3 underscores", 4, array.length); Assert.assertEquals("Artifact type is missing", 2, array[1].split("-").length); Assert.assertEquals("Wrong object name, expected : artifact", "artifact", array[1].split("-")[0]); Assert.assertTrue("Wrong artifact type, expected : pcd or rgb", types.contains(array[1].split("-")[1])); try { long timestamp = Long.parseLong(array[2]); } catch (NumberFormatException e) { Assert.fail("timestamp is not correct format"); } Assert.assertEquals("Random string generated incorrectly", 16, array[3].length()); }