Should be ok as long as you are doing a NPE check before calling equals() inside compareTo().
One more point would be before doing
test.toLowerCase().compareTo(o.test.toLowerCase());
you must also check if test is NULL because "someString".compareTo((String)null) will throws a NullPointerException.