Update unit.java

fixed missing unit method