public BufferedImage getApplicationIconImage() {
        if (isMac()) {


            try {
                Class<?> nsDataClass = Class.forName("com.apple.cocoa.foundation.NSData");
                Class<?> nsImageClass = Class.forName("com.apple.cocoa.application.NSImage");
                Object application = getNSApplication();
                Object nsImage = application.getClass().getMethod("applicationIconImage", new Class[0]).invoke(application, new Object[0]);

                Object nsData = nsImageClass.getMethod("TIFFRepresentation", new Class<?>[0]).invoke(nsImage, new Object[0]);

                Integer length = (Integer) nsDataClass.getMethod("length", new Class[0]).invoke(nsData, new Object[0]);
                byte[] bytes = (byte[]) nsDataClass.getMethod("bytes", new Class[]{Integer.TYPE, Integer.TYPE}).invoke(nsData, new Object[]{Integer.valueOf(0), length});

                BufferedImage image = ImageIO.read(new ByteArrayInputStream(bytes));
                return image;

            } catch (ClassNotFoundException e) {
                e.printStackTrace();
            } catch (NoSuchMethodException e) {
                throw new RuntimeException(e);
            } catch (IllegalAccessException e) {
                throw new RuntimeException(e);
            } catch (InvocationTargetException e) {
                throw new RuntimeException(e);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }

        }

        return null;
    }