Style { public static int getOverflowProperty( String style ) { if ( style == null ) { return SWT.NONE; } long count = Arrays.stream( style.split( ";" ) ) .map( x -> x.toLowerCase().replace( " ", "" ).split( ":" ) ) .filter( y -> y[ 0 ].equals( "overflow" ) && y[ 1 ].equals( "auto" ) ) .count(); return count != 0 ? SWT.V_SCROLL | SWT.H_SCROLL : SWT.NONE; }  static int getOverflowProperty( String style );  }
@Test public void understandsOverflowAuto() { assertEquals( SWT.V_SCROLL | SWT.H_SCROLL, Style.getOverflowProperty( "overflow:auto;color:red;" ) ); assertEquals( SWT.NONE, Style.getOverflowProperty( "overflow:other;" ) ); }