### Question:
AssetUtils { public static String buildAssetKey( UUID appId, Entity entity ) { Preconditions.checkArgument( entity.getUuid() != null, "The asset provided to buildAssetKey had a null UUID" ); Preconditions.checkArgument( appId != null, "The appId provided to buildAssetKey was null" ); return appId.toString().concat( "/" ).concat( entity.getUuid().toString() ); }  static String buildAssetKey( UUID appId, Entity entity ); static Date fromIfModifiedSince( String headerValue ); static Map<String, Object> getFileMetadata( Entity entity ); static final String FILE_METADATA; static final String CONTENT_TYPE; static final String CONTENT_LENGTH; static final String CONTENT_DISPOSITION; static final String E_TAG; static final String CHECKSUM; static final String LAST_MODIFIED; static final String PATTERN_RFC1123; static final String PATTERN_RFC1036; static final String PATTERN_ASCTIME; static final String[] DEFAULT_PATTERNS; }### Answer:
@Test public void buildPathOk() { Asset asset = new Asset(); asset.setPath( "path/to/file" ); asset.setUuid( UUID.randomUUID() ); String path = AssetUtils.buildAssetKey( appId, asset ); assertEquals( 73, path.length() ); assertEquals( appId.toString(), path.substring( 0, 36 ) ); }
@Test(expected = IllegalArgumentException.class) public void verifyErrorsOkAssetId() { Asset asset = new Asset(); AssetUtils.buildAssetKey( appId, asset ); }
@Test(expected = IllegalArgumentException.class) public void verifyErrorsOkNullAppId() { Asset asset = new Asset(); asset.setUuid( UUID.randomUUID() ); AssetUtils.buildAssetKey( null, asset ); }