private static Map<String, Object> applyStyle( Map<String, Object> style,
		BiFunction<String, Object, Object> applyProperty )
	{
		if( style.isEmpty() )
			return null;

		Map<String, Object> oldValues = new HashMap<>();
		outer:
		for( Map.Entry<String, Object> e : style.entrySet() ) {
			String key = e.getKey();
			Object newValue = e.getValue();

			// handle key prefix
			while( key.startsWith( "[" ) ) {
				int closeIndex = key.indexOf( ']' );
				if( closeIndex < 0 )
					continue outer;

				String prefix = key.substring( 0, closeIndex + 1 );
				String lightOrDarkPrefix = FlatLaf.getUIKeyLightOrDarkPrefix( FlatLaf.isLafDark() );
				if( !lightOrDarkPrefix.equals( prefix ) && !FlatLaf.getUIKeyPlatformPrefixes().contains( prefix ) )
					continue outer;

				// prefix is known and enabled --> remove prefix
				key = key.substring( closeIndex + 1 );
			}

			Object oldValue = applyProperty.apply( key, newValue );
			oldValues.put( key, oldValue );
		}
		return oldValues;
	}
Parses styles in CSS syntax ("key1: value1; key2: value2; ..."),
converts the value strings into binary and invokes the given function
to apply the properties.

@param oldStyleValues map of old values modified by the previous invocation, or {@code null}
@param style the style in CSS syntax as string, or a Map, or {@code null}
@param applyProperty function that is invoked to apply the properties;
                     first parameter is the key, second the binary value;
                     the function must return the old value
@return map of old values modified by the given style, or {@code null}
@throws UnknownStyleException on unknown style keys
@throws IllegalArgumentException on syntax errors
@throws ClassCastException if value type does not fit to expected type
flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatStylingSupport.java