private static void dumpActionMaps( File dir, String nameSuffix,
		LookAndFeel lookAndFeel, UIDefaults defaults )
	{
		// dump to string
		StringWriter stringWriter = new StringWriter( 100000 );
		new UIDefaultsDump( lookAndFeel, defaults ).dumpActionMaps( new PrintWriter( stringWriter ) );

		String name = lookAndFeel instanceof MyBasicLookAndFeel
			? BasicLookAndFeel.class.getSimpleName()
			: lookAndFeel.getClass().getSimpleName();
		String javaVersion = System.getProperty( "java.version" );
		if( javaVersion.startsWith( "1.8.0_" ) && lookAndFeel instanceof FlatLaf )
			javaVersion = "1.8.0";
		File file = new File( dir, name + nameSuffix + "_"
			+ javaVersion + ".txt" );

		// write to file
		file.getParentFile().mkdirs();
		try( Writer fileWriter = new OutputStreamWriter(
			new FileOutputStream( file ), StandardCharsets.UTF_8 ) )
		{
			fileWriter.write( stringWriter.toString().replace( "\r", "" ) );
		} catch( IOException ex ) {
			ex.printStackTrace();
		}
	}
Dumps look and feel UI defaults to files.

@author Karl Tauber
flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/uidefaults/UIDefaultsDump.java