public static boolean isTmpFile(String uri) {
    String[] splits = StringUtils.splitByWholeSeparator(uri, TMP);
    if (splits.length < 2) {
      return false;
    }
    try {
      UUID.fromString(splits[splits.length - 1]);
      return true;
    } catch (IllegalArgumentException e) {
      return false;
    }
  }
@Test
  public void testIsTmpFile() {
    assertTrue(SegmentCompletionUtils.isTmpFile("hdfs://foo.tmp.550e8400-e29b-41d4-a716-446655440000"));
    assertFalse(SegmentCompletionUtils.isTmpFile("hdfs://foo.tmp."));
    assertFalse(SegmentCompletionUtils.isTmpFile(".tmp.550e8400-e29b-41d4-a716-446655440000"));
    assertFalse(SegmentCompletionUtils.isTmpFile("hdfs://foo.tmp.55"));
  }