public static @Nullable String[] removeFirst(@Nullable String[] cur) {
    if (cur == null) {
      return null;
    }
    if (cur.length == 0) {
      return cur;
    }
    if (cur.length == 1) {
      return new String[0];
    }
    String[] res = new String[cur.length -1];
    System.arraycopy(cur, 1, res, 0, res.length);
    return res;
  }
Removes value from given array if present, providing set-like behavior.
android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/util/ArrayUtils.java