public List < String > getClasses ( ) { String classAttr = getAttribute ( "class" ) ; return Stream . of ( ( classAttr == null ? "" : classAttr ) . trim ( ) . split ( "\\s+" ) ) . distinct ( ) . sorted ( ) . collect ( Collectors . toList ( ) ) ; }
Returns the class names present on element . The result is a unique set and is in alphabetical order .