@Override
    public int compareTo(Key key) {
        if (key == null) {
            throw new NullPointerException();
        }

        String otherKey = key.toString();
        if (key_.equals("") && otherKey.equals("")) {
            return 0;
        } else if (key_.equals("") && !otherKey.equals("")) {
            return 1;
        } else if (!key_.equals("") && otherKey.equals("")) {
            return -1;
        }

        int length = Math.min(key_.length(), otherKey.length());
        return Long.valueOf(key_.substring(0, length), 2)
                .compareTo(Long.valueOf(otherKey.substring(0, length), 2));
    }