/*
 * The Alluxio Open Foundation licenses this work under the Apache License, version 2.0
 * (the "License"). You may not use this work except in compliance with the License, which is
 * available at www.apache.org/licenses/LICENSE-2.0
 *
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied, as more fully set forth in the License.
 *
 * See the NOTICE file distributed with this work for information regarding copyright ownership.
 */

package alluxio.util;

import org.junit.Assert;
import org.junit.Test;

/**
 * Tests {@link IdUtils}.
 */
public final class IdUtilsTest {
  /**
   * Tests if output of {@link IdUtils#getRandomNonNegativeLong()} is non-negative.
   * Also tests for randomness property.
   */
  @Test
  public void getRandomNonNegativeLong() throws Exception {
    long first = IdUtils.getRandomNonNegativeLong();
    long second = IdUtils.getRandomNonNegativeLong();
    Assert.assertTrue(first >= 0);
    Assert.assertTrue(second >= 0);
    Assert.assertTrue(first != second);
  }

  /**
   * Tests if output of {@link IdUtils#createFileId(long)} is valid.
   */
  @Test
  public void createFileId() throws Exception {
    long containerId = 1;
    long fileId = IdUtils.createFileId(containerId);
    Assert.assertNotEquals(-1, fileId);
  }

  /**
   * Tests if output of {@link IdUtils#createRpcId()} is non-empty.
   * Also tests for randomness property.
   */
  @Test
  public void createRpcId() throws Exception {
    String first = IdUtils.createRpcId();
    Assert.assertTrue(!first.isEmpty());
    String second = IdUtils.createRpcId();
    Assert.assertTrue(!second.isEmpty());
    Assert.assertNotEquals(first, second);
  }
}

@@ -529,32 +529,39 @@
 o.util;%0A%0Aimport 
+static 
 org.junit.Assert
@@ -560,17 +560,77 @@
 t.Assert
-;
+.assertTrue;%0Aimport static org.junit.Assert.assertNotEquals;%0A
 %0Aimport 
@@ -1021,39 +1021,32 @@
 tiveLong();%0A    
-Assert.
 assertTrue(first
@@ -1049,39 +1049,32 @@
 irst %3E= 0);%0A    
-Assert.
 assertTrue(secon
@@ -1082,31 +1082,24 @@
  %3E= 0);%0A    
-Assert.
 assertTrue(f
@@ -1336,31 +1336,24 @@
 nerId);%0A    
-Assert.
 assertNotEqu
@@ -1588,39 +1588,32 @@
 ateRpcId();%0A    
-Assert.
 assertTrue(!firs
@@ -1669,31 +1669,24 @@
 pcId();%0A    
-Assert.
 assertTrue(!
@@ -1708,23 +1708,16 @@
 ));%0A    
-Assert.
 assertNo

Use static imports for standard test in IdUtilsTest