fixed bugs related to JDK 1.6 source level
used exact meaning of isEmpty(), fixed failing tests