text:
using NPOI.XSSF.Model;
using NPOI.OpenXmlFormats.Spreadsheet;
using NPOI.XSSF.UserModel.Extensions;
using NUnit.Framework;
using NPOI.SS.UserModel;
using NPOI.HSSF.UserModel;
using System.Drawing;
using NPOI.HSSF.Util;
namespace NPOI.XSSF.UserModel
{

    [TestFixture]
    public class TestXSSFCellStyle
    {

        private StylesTable stylesTable;
        private CT_Border ctBorderA;
        private CT_Fill ctFill;
        private CT_Font ctFont;
        private CT_Xf cellStyleXf;
        private CT_Xf cellXf;
        private CT_CellXfs cellXfs;
        private XSSFCellStyle cellStyle;
        private CT_Stylesheet ctStylesheet;

        [SetUp]
        public void SetUp()
        {
            stylesTable = new StylesTable();

            ctStylesheet = stylesTable.GetCTStylesheet();

            ctBorderA = new CT_Border();
            XSSFCellBorder borderA = new XSSFCellBorder(ctBorderA);
            long borderId = stylesTable.PutBorder(borderA);
            Assert.AreEqual(1, borderId);

            XSSFCellBorder borderB = new XSSFCellBorder();
            Assert.AreEqual(1, stylesTable.PutBorder(borderB));

            ctFill = new CT_Fill();
            XSSFCellFill fill = new XSSFCellFill(ctFill);
            long fillId = stylesTable.PutFill(fill);
            Assert.AreEqual(2, fillId);

            ctFont = new CT_Font();
            XSSFFont font = new XSSFFont(ctFont);
            long fontId = stylesTable.PutFont(font);
            Assert.AreEqual(1, fontId);

            cellStyleXf = ctStylesheet.AddNewCellStyleXfs().AddNewXf();
            cellStyleXf.borderId = 1;
            cellStyleXf.fillId = 1;
            cellStyleXf.fontId = 1;

            cellXfs = ctStylesheet.AddNewCellXfs();
            cellXf = cellXfs.AddNewXf();
            cellXf.xfId = (1);
            cellXf.borderId = (1);
            cellXf.fillId = (1);
            cellXf.fontId = (1);
            stylesTable.PutCellStyleXf(cellStyleXf);
            stylesTable.PutCellXf(cellXf);
            cellStyle = new XSSFCellStyle(1, 1, stylesTable, null);
        }
        [Test]
        public void TestGetSetBorderBottom()
        {
            //default values
            Assert.AreEqual(BorderStyle.None, cellStyle.BorderBottom);

            int num = stylesTable.GetBorders().Count;
            cellStyle.BorderBottom = (BorderStyle.Medium);
            Assert.AreEqual(BorderStyle.Medium, cellStyle.BorderBottom);
            //a new border has been Added
            Assert.AreEqual(num + 1, stylesTable.GetBorders().Count);
            //id of the Created border
            int borderId = (int)cellStyle.GetCoreXf().borderId;
            Assert.IsTrue(borderId > 0);
            //check Changes in the underlying xml bean
            CT_Border ctBorder = stylesTable.GetBorderAt(borderId).GetCTBorder();
            Assert.AreEqual(ST_BorderStyle.medium, ctBorder.bottom.style);

            num = stylesTable.GetBorders().Count;
            //setting the same border multiple times should not change borderId
            for (int i = 0; i < 3; i++)
            {
                cellStyle.BorderBottom = (BorderStyle.Medium);
                Assert.AreEqual(BorderStyle.Medium, cellStyle.BorderBottom);
            }
            Assert.AreEqual((uint)borderId, cellStyle.GetCoreXf().borderId);
            Assert.AreEqual(num, stylesTable.GetBorders().Count);
            Assert.AreSame(ctBorder, stylesTable.GetBorderAt(borderId).GetCTBorder());

            //setting border to none Removes the <bottom> element
            cellStyle.BorderBottom = (BorderStyle.None);
            Assert.AreEqual(num, stylesTable.GetBorders().Count);
            borderId = (int)cellStyle.GetCoreXf().borderId;
            ctBorder = stylesTable.GetBorderAt(borderId).GetCTBorder();
            Assert.IsFalse(ctBorder.IsSetBottom());
        }
        [Test]
        public void TestSetServeralBordersOnSameCell()
        {
            Assert.AreEqual(BorderStyle.None, cellStyle.BorderRight);
            Assert.AreEqual(BorderStyle.None, cellStyle.BorderLeft);
            Assert.AreEqual(BorderStyle.None, cellStyle.BorderTop);
            Assert.AreEqual(BorderStyle.None, cellStyle.BorderBottom);
            Assert.AreEqual(2, stylesTable.GetBorders().Count);

            cellStyle.BorderBottom = BorderStyle.Thin;
            cellStyle.BottomBorderColor = HSSFColor.Black.Index;
            cellStyle.BorderLeft = BorderStyle.DashDotDot;
            cellStyle.LeftBorderColor = HSSFColor.Green.Index;
            cellStyle.BorderRight = BorderStyle.Hair;
            cellStyle.RightBorderColor = HSSFColor.Blue.Index;
            cellStyle.BorderTop = BorderStyle.MediumDashed;
            cellStyle.TopBorderColor = HSSFColor.Orange.Index;
            //only one border style should be generated
            Assert.AreEqual(3, stylesTable.GetBorders().Count);

        }
        [Test]
        public void TestGetSetBorderDiagonal()
        {
            Assert.AreEqual(BorderDiagonal.None, cellStyle.BorderDiagonal);

            int num = stylesTable.GetBorders().Count;
            cellStyle.BorderDiagonalLineStyle = BorderStyle.Medium;
            cellStyle.BorderDiagonalColor = HSSFColor.Red.Index;
            cellStyle.BorderDiagonal = BorderDiagonal.Backward;

            Assert.AreEqual(BorderStyle.Medium, cellStyle.BorderDiagonalLineStyle);
            //a new border has been added
            Assert.AreEqual(num + 1, stylesTable.GetBorders().Count);
            //id of the created border
            uint borderId = cellStyle.GetCoreXf().borderId;
            Assert.IsTrue(borderId > 0);

            CT_Border ctBorder = stylesTable.GetBorderAt((int)borderId).GetCTBorder();
            Assert.AreEqual(ST_BorderStyle.medium, ctBorder.diagonal.style);

            num = stylesTable.GetBorders().Count;
            //setting the same border multiple times should not change borderId
            for (int i = 0; i < 3; i++)
            {
                cellStyle.BorderDiagonal = BorderDiagonal.Backward;
                Assert.AreEqual(BorderDiagonal.Backward, cellStyle.BorderDiagonal);
            }
            Assert.AreEqual(borderId, cellStyle.GetCoreXf().borderId);
            Assert.AreEqual(num, stylesTable.GetBorders().Count);
            Assert.AreSame(ctBorder, stylesTable.GetBorderAt((int)borderId).GetCTBorder());

            cellStyle.BorderDiagonal = (BorderDiagonal.None);
            Assert.AreEqual(num, stylesTable.GetBorders().Count);
            borderId = cellStyle.GetCoreXf().borderId;
            ctBorder = stylesTable.GetBorderAt((int)borderId).GetCTBorder();
            Assert.IsFalse(ctBorder.IsSetDiagonal());
        }
        [Test]
        public void TestGetSetBorderRight()
        {
            //default values
            Assert.AreEqual(BorderStyle.None, cellStyle.BorderRight);

            int num = stylesTable.GetBorders().Count;
            cellStyle.BorderRight = (BorderStyle.Medium);
            Assert.AreEqual(BorderStyle.Medium, cellStyle.BorderRight);
            //a new border has been Added
            Assert.AreEqual(num + 1, stylesTable.GetBorders().Count);
            //id of the Created border
            uint borderId = cellStyle.GetCoreXf().borderId;
            Assert.IsTrue(borderId > 0);
            //check Changes in the underlying xml bean
            CT_Border ctBorder = stylesTable.GetBorderAt((int)borderId).GetCTBorder();
            Assert.AreEqual(ST_BorderStyle.medium, ctBorder.right.style);

            num = stylesTable.GetBorders().Count;
            //setting the same border multiple times should not change borderId
            for (int i = 0; i < 3; i++)
            {
                cellStyle.BorderRight = (BorderStyle.Medium);
                Assert.AreEqual(BorderStyle.Medium, cellStyle.BorderRight);
            }
            Assert.AreEqual(borderId, cellStyle.GetCoreXf().borderId);
            Assert.AreEqual(num, stylesTable.GetBorders().Count);
            Assert.AreSame(ctBorder, stylesTable.GetBorderAt((int)borderId).GetCTBorder());

            //setting border to none Removes the <right> element
            cellStyle.BorderRight = (BorderStyle.None);
            Assert.AreEqual(num, stylesTable.GetBorders().Count);
            borderId = cellStyle.GetCoreXf().borderId;
            ctBorder = stylesTable.GetBorderAt((int)borderId).GetCTBorder();
            Assert.IsFalse(ctBorder.IsSetRight());
        }
        [Test]
        public void TestGetSetBorderLeft()
        {
            //default values
            Assert.AreEqual(BorderStyle.None, cellStyle.BorderLeft);

            int num = stylesTable.GetBorders().Count;
            cellStyle.BorderLeft = (BorderStyle.Medium);
            Assert.AreEqual(BorderStyle.Medium, cellStyle.BorderLeft);
            //a new border has been Added
            Assert.AreEqual(num + 1, stylesTable.GetBorders().Count);
            //id of the Created border
            uint borderId = cellStyle.GetCoreXf().borderId;
            Assert.IsTrue(borderId > 0);
            //check Changes in the underlying xml bean
            CT_Border ctBorder = stylesTable.GetBorderAt((int)borderId).GetCTBorder();
            Assert.AreEqual(ST_BorderStyle.medium, ctBorder.left.style);

            num = stylesTable.GetBorders().Count;
            //setting the same border multiple times should not change borderId
            for (int i = 0; i < 3; i++)
            {
                cellStyle.BorderLeft = (BorderStyle.Medium);
                Assert.AreEqual(BorderStyle.Medium, cellStyle.BorderLeft);
            }
            Assert.AreEqual(borderId, cellStyle.GetCoreXf().borderId);
            Assert.AreEqual(num, stylesTable.GetBorders().Count);
            Assert.AreSame(ctBorder, stylesTable.GetBorderAt((int)borderId).GetCTBorder());

            //setting border to none Removes the <left> element
            cellStyle.BorderLeft = (BorderStyle.None);
            Assert.AreEqual(num, stylesTable.GetBorders().Count);
            borderId = cellStyle.GetCoreXf().borderId;
            ctBorder = stylesTable.GetBorderAt((int)borderId).GetCTBorder();
            Assert.IsFalse(ctBorder.IsSetLeft());
        }
        [Test]
        public void TestGetSetBorderTop()
        {
            //default values
            Assert.AreEqual(BorderStyle.None, cellStyle.BorderTop);

            int num = stylesTable.GetBorders().Count;
            cellStyle.BorderTop = BorderStyle.Medium;
            Assert.AreEqual(BorderStyle.Medium, cellStyle.BorderTop);
            //a new border has been Added
            Assert.AreEqual(num + 1, stylesTable.GetBorders().Count);
            //id of the Created border
            uint borderId = cellStyle.GetCoreXf().borderId;
            Assert.IsTrue(borderId > 0);
            //check Changes in the underlying xml bean
            CT_Border ctBorder = stylesTable.GetBorderAt((int)borderId).GetCTBorder();
            Assert.AreEqual(ST_BorderStyle.medium, ctBorder.top.style);

            num = stylesTable.GetBorders().Count;
            //setting the same border multiple times should not change borderId
            for (int i = 0; i < 3; i++)
            {
                cellStyle.BorderTop = BorderStyle.Medium;
                Assert.AreEqual(BorderStyle.Medium, cellStyle.BorderTop);
            }
            Assert.AreEqual((uint)borderId, cellStyle.GetCoreXf().borderId);
            Assert.AreEqual(num, stylesTable.GetBorders().Count);
            Assert.AreSame(ctBorder, stylesTable.GetBorderAt((int)borderId).GetCTBorder());

            //setting border to none Removes the <top> element
            cellStyle.BorderTop = BorderStyle.None;
            Assert.AreEqual(num, stylesTable.GetBorders().Count);
            borderId = cellStyle.GetCoreXf().borderId;
            ctBorder = stylesTable.GetBorderAt((int)borderId).GetCTBorder();
            Assert.IsFalse(ctBorder.IsSetTop());
        }
        [Test]
        public void TestGetSetBottomBorderColor()
        {
            //defaults
            Assert.AreEqual(IndexedColors.Black.Index, cellStyle.BottomBorderColor);
            Assert.IsNull(cellStyle.BottomBorderXSSFColor);

            int num = stylesTable.GetBorders().Count;

            XSSFColor clr;

            //setting indexed color
            cellStyle.BottomBorderColor = (IndexedColors.BlueGrey.Index);
            Assert.AreEqual(IndexedColors.BlueGrey.Index, cellStyle.BottomBorderColor);
            clr = cellStyle.BottomBorderXSSFColor;
            Assert.IsTrue(clr.GetCTColor().IsSetIndexed());
            Assert.AreEqual(IndexedColors.BlueGrey.Index, clr.Indexed);
            //a new border was Added to the styles table
            Assert.AreEqual(num + 1, stylesTable.GetBorders().Count);

            //id of the Created border
            uint borderId = cellStyle.GetCoreXf().borderId;
            Assert.IsTrue(borderId > 0);
            //check Changes in the underlying xml bean
            CT_Border ctBorder = stylesTable.GetBorderAt((int)borderId).GetCTBorder();
            Assert.AreEqual((uint)IndexedColors.BlueGrey.Index, ctBorder.bottom.color.indexed);

            //setting XSSFColor
            num = stylesTable.GetBorders().Count;
            clr = new XSSFColor(Color.Cyan);
            cellStyle.SetBottomBorderColor(clr);
            Assert.AreEqual(clr.GetCTColor().ToString(), cellStyle.BottomBorderXSSFColor.GetCTColor().ToString());
            byte[] rgb = cellStyle.BottomBorderXSSFColor.GetRgb();
            Assert.AreEqual(Color.Cyan.ToArgb(), Color.FromArgb(rgb[0] & 0xFF, rgb[1] & 0xFF, rgb[2] & 0xFF).ToArgb());
            //another border was Added to the styles table
            Assert.AreEqual(num, stylesTable.GetBorders().Count);

            //passing null unsets the color
            cellStyle.SetBottomBorderColor(null);
            Assert.IsNull(cellStyle.BottomBorderXSSFColor);
        }
        [Test]
        public void TestGetSetTopBorderColor()
        {
            //defaults
            Assert.AreEqual(IndexedColors.Black.Index, cellStyle.TopBorderColor);
            Assert.IsNull(cellStyle.TopBorderXSSFColor);

            int num = stylesTable.GetBorders().Count;

            XSSFColor clr;

            //setting indexed color
            cellStyle.TopBorderColor = (IndexedColors.BlueGrey.Index);
            Assert.AreEqual(IndexedColors.BlueGrey.Index, cellStyle.TopBorderColor);
            clr = cellStyle.TopBorderXSSFColor;
            Assert.IsTrue(clr.GetCTColor().IsSetIndexed());
            Assert.AreEqual(IndexedColors.BlueGrey.Index, clr.Indexed);
            //a new border was added to the styles table
            Assert.AreEqual(num + 1, stylesTable.GetBorders().Count);

            //id of the Created border
            int borderId = (int)cellStyle.GetCoreXf().borderId;
            Assert.IsTrue(borderId > 0);
            //check Changes in the underlying xml bean
            CT_Border ctBorder = stylesTable.GetBorderAt(borderId).GetCTBorder();
            Assert.AreEqual((uint)IndexedColors.BlueGrey.Index, ctBorder.top.color.indexed);

            //setting XSSFColor
            num = stylesTable.GetBorders().Count;
            clr = new XSSFColor(Color.Cyan);
            cellStyle.SetTopBorderColor(clr);
            Assert.AreEqual(clr.GetCTColor().ToString(), cellStyle.TopBorderXSSFColor.GetCTColor().ToString());
            byte[] rgb = cellStyle.TopBorderXSSFColor.GetRgb();
            Assert.AreEqual(Color.Cyan.ToArgb(), Color.FromArgb(rgb[0], rgb[1], rgb[2]).ToArgb());
            //another border was added to the styles table
            Assert.AreEqual(num, stylesTable.GetBorders().Count);

            //passing null unsets the color
            cellStyle.SetTopBorderColor(null);
            Assert.IsNull(cellStyle.TopBorderXSSFColor);
        }
        [Test]
        public void TestGetSetLeftBorderColor()
        {
            //defaults
            Assert.AreEqual(IndexedColors.Black.Index, cellStyle.LeftBorderColor);
            Assert.IsNull(cellStyle.LeftBorderXSSFColor);

            int num = stylesTable.GetBorders().Count;

            XSSFColor clr;

            //setting indexed color
            cellStyle.LeftBorderColor = (IndexedColors.BlueGrey.Index);
            Assert.AreEqual(IndexedColors.BlueGrey.Index, cellStyle.LeftBorderColor);
            clr = cellStyle.LeftBorderXSSFColor;
            Assert.IsTrue(clr.GetCTColor().IsSetIndexed());
            Assert.AreEqual(IndexedColors.BlueGrey.Index, clr.Indexed);
            //a new border was Added to the styles table
            Assert.AreEqual(num + 1, stylesTable.GetBorders().Count);

            //id of the Created border
            int borderId = (int)cellStyle.GetCoreXf().borderId;
            Assert.IsTrue(borderId > 0);
            //check Changes in the underlying xml bean
            CT_Border ctBorder = stylesTable.GetBorderAt(borderId).GetCTBorder();
            Assert.AreEqual((uint)IndexedColors.BlueGrey.Index, ctBorder.left.color.indexed);

            //setting XSSFColor
            num = stylesTable.GetBorders().Count;
            clr = new XSSFColor(Color.Cyan);
            cellStyle.SetLeftBorderColor(clr);
            Assert.AreEqual(clr.GetCTColor().ToString(), cellStyle.LeftBorderXSSFColor.GetCTColor().ToString());
            byte[] rgb = cellStyle.LeftBorderXSSFColor.GetRgb();
            Assert.AreEqual(Color.Cyan.ToArgb(), Color.FromArgb(rgb[0] & 0xFF, rgb[1] & 0xFF, rgb[2] & 0xFF).ToArgb());
            //another border was Added to the styles table
            Assert.AreEqual(num, stylesTable.GetBorders().Count);

            //passing null unsets the color
            cellStyle.SetLeftBorderColor(null);
            Assert.IsNull(cellStyle.LeftBorderXSSFColor);
        }
        [Test]
        public void TestGetSetRightBorderColor()
        {
            //defaults
            Assert.AreEqual(IndexedColors.Black.Index, cellStyle.RightBorderColor);
            Assert.IsNull(cellStyle.RightBorderXSSFColor);

            int num = stylesTable.GetBorders().Count;

            XSSFColor clr;

            //setting indexed color
            cellStyle.RightBorderColor = (IndexedColors.BlueGrey.Index);
            Assert.AreEqual(IndexedColors.BlueGrey.Index, cellStyle.RightBorderColor);
            clr = cellStyle.RightBorderXSSFColor;
            Assert.IsTrue(clr.GetCTColor().IsSetIndexed());
            Assert.AreEqual(IndexedColors.BlueGrey.Index, clr.Indexed);
            //a new border was Added to the styles table
            Assert.AreEqual(num + 1, stylesTable.GetBorders().Count);

            //id of the Created border
            int borderId = (int)cellStyle.GetCoreXf().borderId;
            Assert.IsTrue(borderId > 0);
            //check Changes in the underlying xml bean
            CT_Border ctBorder = stylesTable.GetBorderAt(borderId).GetCTBorder();
            Assert.AreEqual((uint)IndexedColors.BlueGrey.Index, ctBorder.right.color.indexed);

            //setting XSSFColor
            num = stylesTable.GetBorders().Count;
            clr = new XSSFColor(Color.Cyan);
            cellStyle.SetRightBorderColor(clr);
            Assert.AreEqual(clr.GetCTColor().ToString(), cellStyle.RightBorderXSSFColor.GetCTColor().ToString());
            byte[] rgb = cellStyle.RightBorderXSSFColor.GetRgb();
            Assert.AreEqual(Color.Cyan.ToArgb(), Color.FromArgb(rgb[0] & 0xFF, rgb[1] & 0xFF, rgb[2] & 0xFF).ToArgb());
            //another border was Added to the styles table
            Assert.AreEqual(num, stylesTable.GetBorders().Count);

            //passing null unsets the color
            cellStyle.SetRightBorderColor(null);
            Assert.IsNull(cellStyle.RightBorderXSSFColor);
        }

        [Test]
        public void TestGetSetFillBackgroundColor()
        {
            Assert.AreEqual(IndexedColors.Automatic.Index, cellStyle.FillBackgroundColor);
            Assert.IsNull(cellStyle.FillBackgroundColorColor);

            XSSFColor clr;

            int num = stylesTable.GetFills().Count;

            //setting indexed color
            cellStyle.FillBackgroundColor = (IndexedColors.Red.Index);
            Assert.AreEqual(IndexedColors.Red.Index, cellStyle.FillBackgroundColor);
            clr = (XSSFColor)cellStyle.FillBackgroundColorColor;
            Assert.IsTrue(clr.GetCTColor().IsSetIndexed());
            Assert.AreEqual(IndexedColors.Red.Index, clr.Indexed);
            //a new fill was Added to the styles table
            Assert.AreEqual(num + 1, stylesTable.GetFills().Count);

            //id of the Created border
            int FillId = (int)cellStyle.GetCoreXf().fillId;
            Assert.IsTrue(FillId > 0);
            //check changes in the underlying xml bean
            CT_Fill ctFill = stylesTable.GetFillAt(FillId).GetCTFill();
            Assert.AreEqual((uint)IndexedColors.Red.Index, ctFill.GetPatternFill().bgColor.indexed);

            //setting XSSFColor
            num = stylesTable.GetFills().Count;
            clr = new XSSFColor(Color.Cyan);
            cellStyle.SetFillBackgroundColor(clr); // TODO this testcase assumes that cellStyle creates a new CT_Fill, but the implementation changes the existing style. - do not know whats right 8-(
            Assert.AreEqual(clr.GetCTColor().ToString(), ((XSSFColor)cellStyle.FillBackgroundColorColor).GetCTColor().ToString());
            byte[] rgb = ((XSSFColor)cellStyle.FillBackgroundColorColor).GetRgb();
            Assert.AreEqual(Color.Cyan.ToArgb(), Color.FromArgb(rgb[0] & 0xFF, rgb[1] & 0xFF, rgb[2] & 0xFF).ToArgb());
            //another border was added to the styles table
            Assert.AreEqual(num, stylesTable.GetFills().Count);

            //passing null unsets the color
            cellStyle.SetFillBackgroundColor(null);
            Assert.IsNull(cellStyle.FillBackgroundColorColor);
            Assert.AreEqual(IndexedColors.Automatic.Index, cellStyle.FillBackgroundColor);
        }
        [Test]
        public void TestDefaultStyles()
        {

            XSSFWorkbook wb1 = new XSSFWorkbook();

            XSSFCellStyle style1 = (XSSFCellStyle)wb1.CreateCellStyle();
            Assert.AreEqual(IndexedColors.Automatic.Index, style1.FillBackgroundColor);
            Assert.IsNull(style1.FillBackgroundColorColor);

            //compatibility with HSSF
            HSSFWorkbook wb2 = new HSSFWorkbook();
            HSSFCellStyle style2 = (HSSFCellStyle)wb2.CreateCellStyle();
            Assert.AreEqual(style2.FillBackgroundColor, style1.FillBackgroundColor);
            Assert.AreEqual(style2.FillForegroundColor, style1.FillForegroundColor);
            Assert.AreEqual(style2.FillPattern, style1.FillPattern);

            Assert.AreEqual(style2.LeftBorderColor, style1.LeftBorderColor);
            Assert.AreEqual(style2.TopBorderColor, style1.TopBorderColor);
            Assert.AreEqual(style2.RightBorderColor, style1.RightBorderColor);
            Assert.AreEqual(style2.BottomBorderColor, style1.BottomBorderColor);

            Assert.AreEqual(style2.BorderBottom, style1.BorderBottom);
            Assert.AreEqual(style2.BorderLeft, style1.BorderLeft);
            Assert.AreEqual(style2.BorderRight, style1.BorderRight);
            Assert.AreEqual(style2.BorderTop, style1.BorderTop);
        }

        [Ignore]
        public void TestGetFillForegroundColor()
        {

            XSSFWorkbook wb = new XSSFWorkbook();
            StylesTable styles = wb.GetStylesSource();
            Assert.AreEqual(1, wb.NumCellStyles);
            Assert.AreEqual(2, styles.GetFills().Count);

            XSSFCellStyle defaultStyle = (XSSFCellStyle)wb.GetCellStyleAt((short)0);
            Assert.AreEqual(IndexedColors.Automatic.Index, defaultStyle.FillForegroundColor);
            Assert.AreEqual(null, defaultStyle.FillForegroundColorColor);
            Assert.AreEqual(FillPattern.NoFill, defaultStyle.FillPattern);

            XSSFCellStyle customStyle = (XSSFCellStyle)wb.CreateCellStyle();

            customStyle.FillPattern = (FillPattern.SolidForeground);
            Assert.AreEqual(FillPattern.SolidForeground, customStyle.FillPattern);
            Assert.AreEqual(3, styles.GetFills().Count);

            customStyle.FillForegroundColor = (IndexedColors.BrightGreen.Index);
            Assert.AreEqual(IndexedColors.BrightGreen.Index, customStyle.FillForegroundColor);
            Assert.AreEqual(4, styles.GetFills().Count);

            for (int i = 0; i < 3; i++)
            {
                XSSFCellStyle style = (XSSFCellStyle)wb.CreateCellStyle();

                style.FillPattern = (FillPattern.SolidForeground);
                Assert.AreEqual(FillPattern.SolidForeground, style.FillPattern);
                Assert.AreEqual(4, styles.GetFills().Count);

                style.FillForegroundColor = (IndexedColors.BrightGreen.Index);
                Assert.AreEqual(IndexedColors.BrightGreen.Index, style.FillForegroundColor);
                Assert.AreEqual(4, styles.GetFills().Count);
            }
        }
        [Test]
        public void TestGetFillPattern()
        {

            Assert.AreEqual(FillPattern.NoFill, cellStyle.FillPattern);

            int num = stylesTable.GetFills().Count;
            cellStyle.FillPattern = (FillPattern.SolidForeground);
            Assert.AreEqual(FillPattern.SolidForeground, cellStyle.FillPattern);
            Assert.AreEqual(num + 1, stylesTable.GetFills().Count);
            int FillId = (int)cellStyle.GetCoreXf().fillId;
            Assert.IsTrue(FillId > 0);
            //check Changes in the underlying xml bean
            CT_Fill ctFill = stylesTable.GetFillAt(FillId).GetCTFill();
            Assert.AreEqual(ST_PatternType.solid, ctFill.GetPatternFill().patternType);

            //setting the same fill multiple time does not update the styles table
            for (int i = 0; i < 3; i++)
            {
                cellStyle.FillPattern = (FillPattern.SolidForeground);
            }
            Assert.AreEqual(num + 1, stylesTable.GetFills().Count);

            cellStyle.FillPattern = (FillPattern.NoFill);
            Assert.AreEqual(FillPattern.NoFill, cellStyle.FillPattern);
            FillId = (int)cellStyle.GetCoreXf().fillId;
            ctFill = stylesTable.GetFillAt(FillId).GetCTFill();
            Assert.IsFalse(ctFill.GetPatternFill().IsSetPatternType());

        }
        [Test]
        public void TestGetFont()
        {
            Assert.IsNotNull(cellStyle.GetFont());
        }
        [Test]
        public void TestGetSetHidden()
        {
            Assert.IsFalse(cellStyle.IsHidden);
            cellStyle.IsHidden = (true);
            Assert.IsTrue(cellStyle.IsHidden);
            cellStyle.IsHidden = (false);
            Assert.IsFalse(cellStyle.IsHidden);
        }
        [Test]
        public void TestGetSetLocked()
        {
            Assert.IsTrue(cellStyle.IsLocked);
            cellStyle.IsLocked = (true);
            Assert.IsTrue(cellStyle.IsLocked);
            cellStyle.IsLocked = (false);
            Assert.IsFalse(cellStyle.IsLocked);
        }
        [Test]
        public void TestGetSetIndent()
        {
            Assert.AreEqual((short)0, cellStyle.Indention);
            cellStyle.Indention = ((short)3);
            Assert.AreEqual((short)3, cellStyle.Indention);
            cellStyle.Indention = ((short)13);
            Assert.AreEqual((short)13, cellStyle.Indention);
        }
        [Test]
        public void TestGetSetAlignement()
        {
            Assert.IsTrue(!cellStyle.GetCellAlignment().GetCTCellAlignment().horizontalSpecified);
            Assert.AreEqual(HorizontalAlignment.General, cellStyle.Alignment);

            cellStyle.Alignment = HorizontalAlignment.Left;
            Assert.AreEqual(HorizontalAlignment.Left, cellStyle.Alignment);
            Assert.AreEqual(ST_HorizontalAlignment.left, cellStyle.GetCellAlignment().GetCTCellAlignment().horizontal);

            cellStyle.Alignment = (HorizontalAlignment.Justify);
            Assert.AreEqual(HorizontalAlignment.Justify, cellStyle.Alignment);
            Assert.AreEqual(ST_HorizontalAlignment.justify, cellStyle.GetCellAlignment().GetCTCellAlignment().horizontal);

            cellStyle.Alignment = (HorizontalAlignment.Center);
            Assert.AreEqual(HorizontalAlignment.Center, cellStyle.Alignment);
            Assert.AreEqual(ST_HorizontalAlignment.center, cellStyle.GetCellAlignment().GetCTCellAlignment().horizontal);
        }
        [Test]
        public void TestGetSetVerticalAlignment()
        {
            Assert.AreEqual(VerticalAlignment.Bottom, cellStyle.VerticalAlignment);
            Assert.IsTrue(!cellStyle.GetCellAlignment().GetCTCellAlignment().verticalSpecified);

            cellStyle.VerticalAlignment = (VerticalAlignment.Top);
            Assert.AreEqual(VerticalAlignment.Top, cellStyle.VerticalAlignment);
            Assert.AreEqual(ST_VerticalAlignment.top, cellStyle.GetCellAlignment().GetCTCellAlignment().vertical);

            cellStyle.VerticalAlignment = (VerticalAlignment.Center);
            Assert.AreEqual(VerticalAlignment.Center, cellStyle.VerticalAlignment);
            Assert.AreEqual(ST_VerticalAlignment.center, cellStyle.GetCellAlignment().GetCTCellAlignment().vertical);

            cellStyle.VerticalAlignment = VerticalAlignment.Justify;
            Assert.AreEqual(VerticalAlignment.Justify, cellStyle.VerticalAlignment);
            Assert.AreEqual(ST_VerticalAlignment.justify, cellStyle.GetCellAlignment().GetCTCellAlignment().vertical);

            cellStyle.VerticalAlignment = (VerticalAlignment.Bottom);
            Assert.AreEqual(VerticalAlignment.Bottom, cellStyle.VerticalAlignment);
            Assert.AreEqual(ST_VerticalAlignment.bottom, cellStyle.GetCellAlignment().GetCTCellAlignment().vertical);
        }
        [Test]
        public void TestGetSetWrapText()
        {
            Assert.IsFalse(cellStyle.WrapText);
            cellStyle.WrapText = (true);
            Assert.IsTrue(cellStyle.WrapText);
            cellStyle.WrapText = (false);
            Assert.IsFalse(cellStyle.WrapText);
        }

        /**
         * Cloning one XSSFCellStyle onto Another, same XSSFWorkbook
         */
        [Test]
        public void TestCloneStyleSameWB()
        {
            XSSFWorkbook wb = new XSSFWorkbook();
            Assert.AreEqual(1, wb.NumberOfFonts);

            XSSFFont fnt = (XSSFFont)wb.CreateFont();
            fnt.FontName = ("TestingFont");
            Assert.AreEqual(2, wb.NumberOfFonts);

            XSSFCellStyle orig = (XSSFCellStyle)wb.CreateCellStyle();
            orig.Alignment = (HorizontalAlignment.Right);
            orig.SetFont(fnt);
            orig.DataFormat = (short)18;

            Assert.AreEqual(HorizontalAlignment.Right, orig.Alignment);
            Assert.AreEqual(fnt, orig.GetFont());
            Assert.AreEqual(18, orig.DataFormat);

            XSSFCellStyle clone = (XSSFCellStyle)wb.CreateCellStyle();
            Assert.AreNotEqual(HorizontalAlignment.Right, clone.Alignment);
            Assert.AreNotEqual(fnt, clone.GetFont());
            Assert.AreNotEqual(18, clone.DataFormat);

            clone.CloneStyleFrom(orig);
            Assert.AreEqual(HorizontalAlignment.Right, clone.Alignment);
            Assert.AreEqual(fnt, clone.GetFont());
            Assert.AreEqual(18, clone.DataFormat);
            Assert.AreEqual(2, wb.NumberOfFonts);
        }
        /**
         * Cloning one XSSFCellStyle onto Another, different XSSFWorkbooks
         */
        [Test]
        public void TestCloneStyleDiffWB()
        {
            XSSFWorkbook wbOrig = new XSSFWorkbook();
            Assert.AreEqual(1, wbOrig.NumberOfFonts);
            Assert.AreEqual(0, wbOrig.GetStylesSource().GetNumberFormats().Count);

            XSSFFont fnt = (XSSFFont)wbOrig.CreateFont();
            fnt.FontName = ("TestingFont");
            Assert.AreEqual(2, wbOrig.NumberOfFonts);
            Assert.AreEqual(0, wbOrig.GetStylesSource().GetNumberFormats().Count);

            XSSFDataFormat fmt = (XSSFDataFormat)wbOrig.CreateDataFormat();
            fmt.GetFormat("MadeUpOne");
            fmt.GetFormat("MadeUpTwo");

            XSSFCellStyle orig = (XSSFCellStyle)wbOrig.CreateCellStyle();
            orig.Alignment = (HorizontalAlignment.Right);
            orig.SetFont(fnt);
            orig.DataFormat = (fmt.GetFormat("Test##"));

            Assert.IsTrue(HorizontalAlignment.Right == orig.Alignment);
            Assert.IsTrue(fnt == orig.GetFont());
            Assert.IsTrue(fmt.GetFormat("Test##") == orig.DataFormat);

            Assert.AreEqual(2, wbOrig.NumberOfFonts);
            Assert.AreEqual(3, wbOrig.GetStylesSource().GetNumberFormats().Count);

            // Now a style on another workbook
            XSSFWorkbook wbClone = new XSSFWorkbook();
            Assert.AreEqual(1, wbClone.NumberOfFonts);
            Assert.AreEqual(0, wbClone.GetStylesSource().GetNumberFormats().Count);
            Assert.AreEqual(1, wbClone.NumCellStyles);

            XSSFDataFormat fmtClone = (XSSFDataFormat)wbClone.CreateDataFormat();
            XSSFCellStyle clone = (XSSFCellStyle)wbClone.CreateCellStyle();

            Assert.AreEqual(1, wbClone.NumberOfFonts);
            Assert.AreEqual(0, wbClone.GetStylesSource().GetNumberFormats().Count);

            Assert.IsFalse(HorizontalAlignment.Right == clone.Alignment);
            Assert.IsFalse("TestingFont" == clone.GetFont().FontName);

            clone.CloneStyleFrom(orig);

            Assert.AreEqual(2, wbClone.NumberOfFonts);
            Assert.AreEqual(2, wbClone.NumCellStyles);
            Assert.AreEqual(1, wbClone.GetStylesSource().GetNumberFormats().Count);

            Assert.AreEqual(HorizontalAlignment.Right, clone.Alignment);
            Assert.AreEqual("TestingFont", clone.GetFont().FontName);
            Assert.AreEqual(fmtClone.GetFormat("Test##"), clone.DataFormat);
            Assert.IsFalse(fmtClone.GetFormat("Test##") == fmt.GetFormat("Test##"));

            // Save it and re-check
            XSSFWorkbook wbReload = (XSSFWorkbook)XSSFTestDataSamples.WriteOutAndReadBack(wbClone);
            Assert.AreEqual(2, wbReload.NumberOfFonts);
            Assert.AreEqual(2, wbReload.NumCellStyles);
            Assert.AreEqual(1, wbReload.GetStylesSource().GetNumberFormats().Count);

            XSSFCellStyle reload = (XSSFCellStyle)wbReload.GetCellStyleAt((short)1);
            Assert.AreEqual(HorizontalAlignment.Right, reload.Alignment);
            Assert.AreEqual("TestingFont", reload.GetFont().FontName);
            Assert.AreEqual(fmtClone.GetFormat("Test##"), reload.DataFormat);
            Assert.IsFalse(fmtClone.GetFormat("Test##") == fmt.GetFormat("Test##"));
        }

        /**
          * Avoid ArrayIndexOutOfBoundsException  when creating cell style
          * in a workbook that has an empty xf table.
          */
        [Test]
        public void TestBug52348()
        {
            XSSFWorkbook workbook = XSSFTestDataSamples.OpenSampleWorkbook("52348.xlsx");
            StylesTable st = workbook.GetStylesSource();
            Assert.AreEqual(0, st.StyleXfsSize);

            XSSFCellStyle style = workbook.CreateCellStyle() as XSSFCellStyle; // no exception at this point
            Assert.IsNull(style.GetStyleXf());
        }

    }
}


text:
import express from 'express';
import webpack from 'webpack';
import webpackDev from 'webpack-dev-middleware';
import webpackHot from 'webpack-hot-middleware';
import configDev from './config.dev.babel';

const app = express();
const compiler = webpack(configDev);

app.use(webpackDev(compiler, {
  publicPath: configDev.output.publicPath,
}));

app.use(webpackHot(compiler));

app.listen(configDev.hotPort, () => {
  console.log('Dev server started at port %d', configDev.hotPort); // eslint-disable-line
});

redpajama_set_name: RedPajamaGithub


text:
package br.com.snr.serviceImpl;

public class EnderecoService {

}


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<config xmlns="http://zanata.org/namespace/config/">
  <url>https://vendors.zanata.redhat.com/</url>
  <project>kie-wb-distributions</project>
  <project-version>7.20.0</project-version>
  <project-type>utf8properties</project-type>

  <locales>
    <locale>es</locale>
    <locale>fr</locale>
    <locale>ja</locale>
    <locale>de</locale>
    <locale>pt-BR</locale>
    <locale map-from="zh_CN">zh-Hans</locale>
  </locales>

</config>


text:
require 'spec_helper'
require 'candy_wrapper/model_wrapper'

describe CandyWrapper::ModelWrapper do
  describe '#update_attributes' do
    let(:model_class) {
      Class.new do
        attr_reader :saved, :attributes

        def save
          @saved = true
        end

        def assign_attributes(attributes)
          @attributes = attributes
        end
      end
    }

    let(:wrap_class) {
      klass = Class.new(CandyWrapper::ModelWrapper) do
        attr_reader :resource, :value

        def setter=(resource, value)
          @resource, @value = resource, value
        end
      end

      klass.send(:wraps, model_class)
      klass
    }

    let(:setter_value) { 'setter value' }
    let(:base_attributes) { { :base => 'base' } }
    let(:attributes) { { :setter => setter_value }.merge(base_attributes) }

    it 'should save the model and trigger the setters on the wrapper' do
      model = model_class.new
      wrap = wrap_class.new(model)

      wrap.update_attributes(attributes)

      model.saved.should be_true
      model.attributes.should be == base_attributes

      wrap.resource.should == model
      wrap.value.should == setter_value
    end
  end
end


text:
pluck.js

// var getLength = pluck('length');
// getLength('SF Giants are going to the World Series!'); //40

module.exports = function pluckPre(name) {
  return function pluck(object) {
    return object[name];
  };
};


text:
import { Code } from '@blueprintjs/core';
import React from 'react';

import { Field } from '../../components';
import { deepGet, deepSet, oneOf } from '../../utils';

export type CompactionConfig = Record<string, any>;

export const COMPACTION_CONFIG_FIELDS: Field<CompactionConfig>[] = [
  {
    name: 'skipOffsetFromLatest',
    type: 'string',
    defaultValue: 'P1D',
    suggestions: ['PT0H', 'PT1H', 'P1D', 'P3D'],
    info: (

        The offset for searching segments to be compacted. Strongly recommended to set for realtime
        dataSources.

    ),
  },
  {
    name: 'tuningConfig.partitionsSpec.type',
    label: 'Partitioning type',
    type: 'string',
    suggestions: ['dynamic', 'hashed', 'range'],
    info: (

        For perfect rollup, you should use either hashed (partitioning based on the
        hash of dimensions in each row) or range (based on several dimensions). For
        best-effort rollup, you should use dynamic.

    ),
  },
  // partitionsSpec type: dynamic
  {
    name: 'tuningConfig.partitionsSpec.maxRowsPerSegment',
    type: 'number',
    defaultValue: 5000000,
    defined: t => deepGet(t, 'tuningConfig.partitionsSpec.type') === 'dynamic',
    info: <>Determines how many rows are in each segment.</>,
  },
  {
    name: 'tuningConfig.partitionsSpec.maxTotalRows',
    type: 'number',
    defaultValue: 20000000,
    defined: t => deepGet(t, 'tuningConfig.partitionsSpec.type') === 'dynamic',
    info: <>Total number of rows in segments waiting for being pushed.</>,
  },
  // partitionsSpec type: hashed
  {
    name: 'tuningConfig.partitionsSpec.targetRowsPerSegment',
    type: 'number',
    zeroMeansUndefined: true,
    placeholder: `(defaults to 500000)`,
    defined: t =>
      deepGet(t, 'tuningConfig.partitionsSpec.type') === 'hashed' &&
      !deepGet(t, 'tuningConfig.partitionsSpec.numShards') &&
      !deepGet(t, 'tuningConfig.partitionsSpec.maxRowsPerSegment'),
    info: (
      <>

          If the segments generated are a sub-optimal size for the requested partition dimensions,
          consider setting this field.

          A target row count for each partition. Each partition will have a row count close to the
          target assuming evenly distributed keys. Defaults to 5 million if numShards is null.

          If numShards is left unspecified, the Parallel task will determine{' '}
          numShards automatically by targetRowsPerSegment.

          Note that either targetRowsPerSegment or numShards will be used
          to evenly distribute rows and find the best partitioning. Leave blank to show all
          properties.

      </>
    ),
  },
  {
    name: 'tuningConfig.partitionsSpec.maxRowsPerSegment',
    type: 'number',
    zeroMeansUndefined: true,
    defined: t =>
      deepGet(t, 'tuningConfig.partitionsSpec.type') === 'hashed' &&
      !deepGet(t, 'tuningConfig.partitionsSpec.numShards') &&
      !deepGet(t, 'tuningConfig.partitionsSpec.targetRowsPerSegment'),
    info: (
      <>

          Target number of rows to include in a partition, should be a number that targets segments
          of 500MB~1GB.

          maxRowsPerSegment renamed to targetRowsPerSegment

          If numShards is left unspecified, the Parallel task will determine{' '}
          numShards automatically by targetRowsPerSegment.

          Note that either targetRowsPerSegment or numShards will be used
          to evenly distribute rows and find the best partitioning. Leave blank to show all
          properties.

      </>
    ),
  },
  {
    name: 'tuningConfig.partitionsSpec.numShards',
    type: 'number',
    zeroMeansUndefined: true,
    defined: t =>
      deepGet(t, 'tuningConfig.partitionsSpec.type') === 'hashed' &&
      !deepGet(t, 'tuningConfig.partitionsSpec.maxRowsPerSegment') &&
      !deepGet(t, 'tuningConfig.partitionsSpec.targetRowsPerSegment'),
    info: (
      <>

          If you know the optimal number of shards and want to speed up the time it takes for
          compaction to run, set this field.

          Directly specify the number of shards to create. If this is specified and
          'intervals' is specified in the granularitySpec, the index task can skip the
          determine intervals/partitions pass through the data.

          Note that either targetRowsPerSegment or numShards will be used
          to evenly distribute rows across partitions and find the best partitioning. Leave blank to
          show all properties.

      </>
    ),
  },
  {
    name: 'tuningConfig.partitionsSpec.partitionDimensions',
    type: 'string-array',
    placeholder: '(all dimensions)',
    defined: t => deepGet(t, 'tuningConfig.partitionsSpec.type') === 'hashed',
    info:
The dimensions to partition on. Leave blank to select all dimensions.
,
  },
  // partitionsSpec type: single_dim, range
  {
    name: 'tuningConfig.partitionsSpec.partitionDimension',
    type: 'string',
    defined: t => deepGet(t, 'tuningConfig.partitionsSpec.type') === 'single_dim',
    required: true,
    info:
The dimension to partition on.
,
  },
  {
    name: 'tuningConfig.partitionsSpec.partitionDimensions',
    type: 'string-array',
    defined: t => deepGet(t, 'tuningConfig.partitionsSpec.type') === 'range',
    required: true,
    info:
The dimensions to partition on.
,
  },
  {
    name: 'tuningConfig.partitionsSpec.targetRowsPerSegment',
    type: 'number',
    zeroMeansUndefined: true,
    defined: t =>
      oneOf(deepGet(t, 'tuningConfig.partitionsSpec.type'), 'single_dim', 'range') &&
      !deepGet(t, 'tuningConfig.partitionsSpec.maxRowsPerSegment'),
    required: (t: CompactionConfig) =>
      !deepGet(t, 'tuningConfig.partitionsSpec.targetRowsPerSegment') &&
      !deepGet(t, 'tuningConfig.partitionsSpec.maxRowsPerSegment'),
    info: (
      <>

          Target number of rows to include in a partition, should be a number that targets segments
          of 500MB~1GB.

          Note that either targetRowsPerSegment or maxRowsPerSegment will
          be used to find the best partitioning. Leave blank to show all properties.

      </>
    ),
  },
  {
    name: 'tuningConfig.partitionsSpec.maxRowsPerSegment',
    type: 'number',
    zeroMeansUndefined: true,
    defined: t =>
      oneOf(deepGet(t, 'tuningConfig.partitionsSpec.type'), 'single_dim', 'range') &&
      !deepGet(t, 'tuningConfig.partitionsSpec.targetRowsPerSegment'),
    required: (t: CompactionConfig) =>
      !deepGet(t, 'tuningConfig.partitionsSpec.targetRowsPerSegment') &&
      !deepGet(t, 'tuningConfig.partitionsSpec.maxRowsPerSegment'),
    info: (
      <>

Maximum number of rows to include in a partition.

          Note that either targetRowsPerSegment or maxRowsPerSegment will
          be used to find the best partitioning. Leave blank to show all properties.

      </>
    ),
  },
  {
    name: 'tuningConfig.partitionsSpec.assumeGrouped',
    type: 'boolean',
    defaultValue: false,
    defined: t => oneOf(deepGet(t, 'tuningConfig.partitionsSpec.type'), 'single_dim', 'range'),
    info: (

        Assume that input data has already been grouped on time and dimensions. Ingestion will run
        faster, but may choose sub-optimal partitions if this assumption is violated.

    ),
  },
  {
    name: 'tuningConfig.maxNumConcurrentSubTasks',
    type: 'number',
    defaultValue: 1,
    min: 1,
    info: (
      <>
        Maximum number of tasks which can be run at the same time. The supervisor task would spawn
        worker tasks up to maxNumConcurrentSubTasks regardless of the available task slots. If this
        value is set to 1, the supervisor task processes data ingestion on its own instead of
        spawning worker tasks. If this value is set to too large, too many worker tasks can be
        created which might block other ingestion.
      </>
    ),
  },
  {
    name: 'tuningConfig.maxColumnsToMerge',
    type: 'number',
    defaultValue: -1,
    min: -1,
    info: (
      <>

          Limit of the number of segments to merge in a single phase when merging segments for
          publishing. This limit affects the total number of columns present in a set of segments to
          merge. If the limit is exceeded, segment merging occurs in multiple phases. Druid merges
          at least 2 segments per phase, regardless of this setting.

Default: -1 (unlimited)

      </>
    ),
  },
  {
    name: 'tuningConfig.totalNumMergeTasks',
    type: 'number',
    defaultValue: 10,
    min: 1,
    defined: t =>
      oneOf(deepGet(t, 'tuningConfig.partitionsSpec.type'), 'hashed', 'single_dim', 'range'),
    info: <>Maximum number of merge tasks which can be run at the same time.</>,
  },
  {
    name: 'tuningConfig.splitHintSpec.maxSplitSize',
    type: 'number',
    defaultValue: 1073741824,
    min: 1000000,
    hideInMore: true,
    adjustment: (t: CompactionConfig) => deepSet(t, 'tuningConfig.splitHintSpec.type', 'maxSize'),
    info: (
      <>
        Maximum number of bytes of input segments to process in a single task. If a single segment
        is larger than this number, it will be processed by itself in a single task (input segments
        are never split across tasks).
      </>
    ),
  },
  {
    name: 'tuningConfig.splitHintSpec.maxNumFiles',
    label: 'Max num files (segments)',
    type: 'number',
    defaultValue: 1000,
    min: 1,
    hideInMore: true,
    adjustment: (t: CompactionConfig) => deepSet(t, 'tuningConfig.splitHintSpec.type', 'maxSize'),
    info: (
      <>
        Maximum number of input segments to process in a single subtask. This limit is to avoid task
        failures when the ingestion spec is too long. There are two known limits on the max size of
        serialized ingestion spec, i.e., the max ZNode size in ZooKeeper (
        jute.maxbuffer) and the max packet size in MySQL (
        max_allowed_packet). These can make ingestion tasks fail if the serialized
        ingestion spec size hits one of them.
      </>
    ),
  },
];


text:
package com.gs.collections.impl.set.immutable.primitive;

import java.io.IOException;
import java.io.Serializable;

import com.gs.collections.api.BooleanIterable;
import com.gs.collections.api.LazyBooleanIterable;
import com.gs.collections.api.bag.primitive.MutableBooleanBag;
import com.gs.collections.api.block.function.primitive.BooleanToObjectFunction;
import com.gs.collections.api.block.function.primitive.ObjectBooleanToObjectFunction;
import com.gs.collections.api.block.predicate.primitive.BooleanPredicate;
import com.gs.collections.api.block.procedure.primitive.BooleanProcedure;
import com.gs.collections.api.iterator.BooleanIterator;
import com.gs.collections.api.list.primitive.MutableBooleanList;
import com.gs.collections.api.set.ImmutableSet;
import com.gs.collections.api.set.primitive.BooleanSet;
import com.gs.collections.api.set.primitive.ImmutableBooleanSet;
import com.gs.collections.api.set.primitive.MutableBooleanSet;
import com.gs.collections.impl.bag.mutable.primitive.BooleanHashBag;
import com.gs.collections.impl.factory.Sets;
import com.gs.collections.impl.iterator.ImmutableEmptyBooleanIterator;
import com.gs.collections.impl.lazy.primitive.LazyBooleanIterableAdapter;
import com.gs.collections.impl.list.mutable.primitive.BooleanArrayList;
import com.gs.collections.impl.set.mutable.primitive.BooleanHashSet;
import net.jcip.annotations.Immutable;

@Immutable
final class ImmutableBooleanEmptySet implements ImmutableBooleanSet, Serializable
{
    static final ImmutableBooleanSet INSTANCE = new ImmutableBooleanEmptySet();

    private static final boolean[] TO_ARRAY = new boolean[0];

    private ImmutableBooleanEmptySet()
    {
        // Singleton
    }

    public ImmutableBooleanSet newWith(boolean element)
    {
        return element ? ImmutableTrueSet.INSTANCE : ImmutableFalseSet.INSTANCE;
    }

    public ImmutableBooleanSet newWithout(boolean element)
    {
        return this;
    }

    public ImmutableBooleanSet newWithAll(BooleanIterable elements)
    {
        ImmutableBooleanSet result = this;
        BooleanIterator booleanIterator = elements.booleanIterator();
        while (booleanIterator.hasNext())
        {
            result = result.newWith(booleanIterator.next());
        }
        return result;
    }

    public ImmutableBooleanSet newWithoutAll(BooleanIterable elements)
    {
        return this;
    }

    public BooleanIterator booleanIterator()
    {
        return ImmutableEmptyBooleanIterator.INSTANCE;
    }

    public void forEach(BooleanProcedure procedure)
    {
    }

    public <T> T injectInto(T injectedValue, ObjectBooleanToObjectFunction<? super T, ? extends T> function)
    {
        return injectedValue;
    }

    public int count(BooleanPredicate predicate)
    {
        return 0;
    }

    public boolean anySatisfy(BooleanPredicate predicate)
    {
        return false;
    }

    public boolean allSatisfy(BooleanPredicate predicate)
    {
        return true;
    }

    public boolean noneSatisfy(BooleanPredicate predicate)
    {
        return false;
    }

    public ImmutableBooleanSet select(BooleanPredicate predicate)
    {
        return this;
    }

    public ImmutableBooleanSet reject(BooleanPredicate predicate)
    {
        return this;
    }

    public boolean detectIfNone(BooleanPredicate predicate, boolean ifNone)
    {
        return ifNone;
    }

    public <V> ImmutableSet<V> collect(BooleanToObjectFunction<? extends V> function)
    {
        return Sets.immutable.with();
    }

    public boolean[] toArray()
    {
        return TO_ARRAY;
    }

    public boolean contains(boolean value)
    {
        return false;
    }

    public boolean containsAll(boolean... source)
    {
        return source.length == 0;
    }

    public boolean containsAll(BooleanIterable source)
    {
        BooleanIterator iterator = source.booleanIterator();
        return !iterator.hasNext();
    }

    public BooleanSet freeze()
    {
        return this;
    }

    public ImmutableBooleanSet toImmutable()
    {
        return this;
    }

    public int size()
    {
        return 0;
    }

    public boolean isEmpty()
    {
        return true;
    }

    public boolean notEmpty()
    {
        return false;
    }

    @Override
    public boolean equals(Object obj)
    {
        if (this == obj)
        {
            return true;
        }

        if (!(obj instanceof BooleanSet))
        {
            return false;
        }

        BooleanSet other = (BooleanSet) obj;
        return other.isEmpty();
    }

    @Override
    public int hashCode()
    {
        return 0;
    }

    @Override
    public String toString()
    {
        return "[]";
    }

    public String makeString()
    {
        return "";
    }

    public String makeString(String separator)
    {
        return "";
    }

    public String makeString(String start, String separator, String end)
    {
        return start + end;
    }

    public void appendString(Appendable appendable)
    {
    }

    public void appendString(Appendable appendable, String separator)
    {
    }

    public void appendString(Appendable appendable, String start, String separator, String end)
    {
        try
        {
            appendable.append(start);
            appendable.append(end);
        }
        catch (IOException e)
        {
            throw new RuntimeException(e);
        }
    }

    public MutableBooleanList toList()
    {
        return BooleanArrayList.newList(this);
    }

    public MutableBooleanSet toSet()
    {
        return BooleanHashSet.newSet(this);
    }

    public MutableBooleanBag toBag()
    {
        return BooleanHashBag.newBag(this);
    }

    public LazyBooleanIterable asLazy()
    {
        return new LazyBooleanIterableAdapter(this);
    }

    private Object writeReplace()
    {
        return new ImmutableBooleanSetSerializationProxy(this);
    }
}


text:
-- phpMyAdmin SQL Dump
-- version 3.2.4
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Apr 05, 2013 at 01:30 PM
-- Server version: 5.1.44
-- PHP Version: 5.3.1

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `database`
--

-- --------------------------------------------------------

--
-- Table structure for table `comment`
--

CREATE TABLE IF NOT EXISTS `comment` (
  `id_comment` mediumint(8) NOT NULL AUTO_INCREMENT,
  `id_game` mediumint(8) NOT NULL DEFAULT '0',
  `id_user` mediumint(8) NOT NULL DEFAULT '0',
  `body` text COLLATE utf8_unicode_ci NOT NULL,
  `created` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id_comment`),
  KEY `id_game` (`id_game`),
  KEY `created` (`created`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `customize`
--

CREATE TABLE IF NOT EXISTS `customize` (
  `id_customize` mediumint(8) NOT NULL AUTO_INCREMENT,
  `id_game` mediumint(8) NOT NULL DEFAULT '0',
  `id_level` tinyint(4) NOT NULL DEFAULT '0',
  `id_item` tinyint(4) NOT NULL DEFAULT '0',
  `value` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `hint` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`id_customize`),
  UNIQUE KEY `id_game` (`id_game`,`id_level`,`id_item`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `game`
--

CREATE TABLE IF NOT EXISTS `game` (
  `id_game` mediumint(8) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `description` text COLLATE utf8_unicode_ci NOT NULL,
  `id_user` mediumint(8) NOT NULL DEFAULT '0',
  `created` int(10) NOT NULL DEFAULT '0',
  `played` int(10) NOT NULL DEFAULT '0',
  `comments` mediumint(8) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id_game`),
  KEY `played` (`played`),
  KEY `created` (`created`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `inventory`
--

CREATE TABLE IF NOT EXISTS `inventory` (
  `id_user` mediumint(8) NOT NULL DEFAULT '0',
  `id_item` mediumint(8) NOT NULL DEFAULT '0',
  UNIQUE KEY `id_user` (`id_user`,`id_item`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `progress`
--

CREATE TABLE IF NOT EXISTS `progress` (
  `id_progress` mediumint(8) NOT NULL AUTO_INCREMENT,
  `id_user` mediumint(8) NOT NULL DEFAULT '0',
  `id_game` mediumint(8) NOT NULL DEFAULT '0',
  `id_level` tinyint(4) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id_progress`),
  UNIQUE KEY `id_user` (`id_user`,`id_game`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `shop`
--

CREATE TABLE IF NOT EXISTS `shop` (
  `id_item` mediumint(8) NOT NULL AUTO_INCREMENT,
  `id_category` tinyint(4) NOT NULL DEFAULT '0',
  `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `description` text COLLATE utf8_unicode_ci NOT NULL,
  `namespace` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `cost` smallint(8) NOT NULL DEFAULT '0',
  `bought` smallint(8) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id_item`),
  KEY `id_category` (`id_category`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `user`
--

CREATE TABLE IF NOT EXISTS `user` (
  `id_user` mediumint(8) NOT NULL AUTO_INCREMENT,
  `id_unique` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `username` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `password` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `email_address` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `registered` int(10) NOT NULL DEFAULT '0',
  `coins` int(10) NOT NULL DEFAULT '0',
  `points` int(10) NOT NULL DEFAULT '0',
  `hat` mediumint(8) NOT NULL DEFAULT '0',
  `charac` mediumint(8) NOT NULL DEFAULT '0',
  `screw` mediumint(8) NOT NULL DEFAULT '0',
  `admin` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id_user`),
  KEY `registered` (`registered`),
  KEY `points` (`points`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;


text:
package org.globalwordnet.api.util

import eu.monnetproject.lang.Language
import org.globalwordnet.api.wn._
import org.scalatest._

class MergeTest extends FlatSpec with Matchers {
  "merge" should "join two lexicons" in {
    val lr1 = LexicalResource(Seq(
      Lexicon("wn30", "label", Language.ENGLISH, "email",
        "license", "version", entries=Seq(LexicalEntry(
          "wn30-cat", Lemma("cat", noun), senses=Seq(
            Sense("wn30-cat-1", "wn30-02121620-n",
              senseRelations=Seq(SenseRelation("wn30-cat-1", derivation)))))),
        synsets=Seq(Synset(
          "wn30-02121620-n", ili=Some("i46593")))
      )))
    val lr2 = LexicalResource(Seq(
      Lexicon("wn31", "label", Language.ENGLISH, "email",
        "license", "version", entries=Seq(LexicalEntry(
          "wn31-cat", Lemma("cat", noun), senses=Seq(
            Sense("wn31-cat-1", "wn31-02124272-n")))),
        synsets=Seq(Synset(
          "wn31-02124272-n", ili=Some("i46593"),
          synsetRelations=Seq(SynsetRelation("wn31-02124272-n", hypernym))))
      )))
    val result = Merge.merge(lr1, lr2)
    result.lexicons should have size 1
    val lexicon = result.lexicons(0)
    lexicon.id should be ("wn30+wn31")
    lexicon.label should be ("label+label")
    lexicon.language should be (Language.ENGLISH)
    lexicon.email should be ("email,email")
    lexicon.license should be ("license,license")
    lexicon.version should be ("version [wn30], version [wn31]")
    lexicon.entries should have size 1
    val entry = lexicon.entries(0)
    entry.id should be ("wn30-cat+wn31-cat")
    entry.lemma should be (Lemma("cat", noun))
    entry.senses should have size 1
    val sense = entry.senses(0)
    sense.id should be (makeId(makeId("cat-n") + makeId("i46593")))
    sense.synsetRef should be ("wn30+wn31-" + makeId("i46593"))
    sense.senseRelations should have size 1
    val senseR = sense.senseRelations(0)
    senseR should be (SenseRelation(sense.id, derivation))
    lexicon.synsets should have size 1
    val synset = lexicon.synsets(0)
    synset.id should be ("wn30+wn31-"+makeId("i46593"))
    synset.ili should be (Some("i46593"))
    synset.synsetRelations should have size 1
    synset.synsetRelations(0) should be (SynsetRelation(synset.id, hypernym))
  }
}


text:
var should = require('chai').should(),
	util = require('util'),
    Validator = require('../lib').Validator;

describe('Given a validator that verifies whether the property of an object is empty', function() {
	var validator, validationErrors;

	before(function() {
		validator = new StringEmptyValidator();
	});

	describe('When validating an empty string value', function() {
		before(function() {
			var objectWithEmptyStringProperty = {
				stringProperty: ''
			};

			validationErrors = validator.validate(objectWithEmptyStringProperty);
		});

		it('Should not return any validation error', function() {
			validationErrors.should.have.length(0);
		});
	});

	describe('When validating a string value', function() {
		before(function() {
			var objectWithStringProperty = {
				stringProperty: 'this-is-a-string'
			};

			validationErrors = validator.validate(objectWithStringProperty);
		});

		it('Should return a validation error that specifies the failing property', function() {
			validationErrors.should.have.deep.property('[0].propertyName', 'stringProperty');
		});

		it('Should return a validation error that specifies a default message which explains the error', function() {
			validationErrors.should.have.deep.property('[0].message', 'stringProperty should be empty.');
		});
	});

	describe('When validating an undefined value', function() {
		before(function() {
			var objectWithUndefinedStringProperty = {
				stringProperty: undefined
			};

			validationErrors = validator.validate(objectWithUndefinedStringProperty);
		});

		it('Should return a validation error', function() {
			validationErrors.should.have.length(1);
		});
	});

	describe('When validating a null value', function() {
		before(function() {
			var objectWithNullStringProperty = {
				stringProperty: null
			};

			validationErrors = validator.validate(objectWithNullStringProperty);
		});

		it('Should return a validation error', function() {
			validationErrors.should.have.length(1);
		});
	});
});

var StringEmptyValidator = function() {
	Validator.call(this);

	this.ruleFor('stringProperty').isEmpty();
};

util.inherits(StringEmptyValidator, Validator);


text:
package com.minggo.pluto.util;

import android.annotation.SuppressLint;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * 字符串操作工具类
 * @author minggo
 * @time 2014-12-2下午2:27:07
 */
public class StringUtils {
	private final static Pattern emailer = Pattern
			.compile("\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*");
	// private final static SimpleDateFormat dateFormater = new
	// SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	// private final static SimpleDateFormat dateFormater2 = new
	private static final String regEx_script = "


text:
import { KernelAPI, KernelManager, KernelMessage } from '@jupyterlab/services';

import { log } from './log';

export async function main(): Promise<void> {
  // Start a python kernel
  const kernelManager = new KernelManager();
  const kernel = await kernelManager.startNew({ name: 'python' });

  // Register a callback for when the kernel changes state.
  kernel.statusChanged.connect((_, status) => {
    log(`Status: ${status}`);
  });

  log('Executing code');
  const future = kernel.requestExecute({ code: 'a = 1' });
  // Handle iopub messages
  future.onIOPub = msg => {
    if (msg.header.msg_type !== 'status') {
      log(msg.content);
    }
  };
  await future.done;
  log('Execution is done');

  log('Send an inspect message');
  const request: KernelMessage.IInspectRequestMsg['content'] = {
    code: 'hello',
    cursor_pos: 4,
    detail_level: 0
  };
  const inspectReply = await kernel.requestInspect(request);
  log('Looking at reply');
  if (inspectReply.content.status === 'ok') {
    log('Inspect reply:');
    log(inspectReply.content.data);
  }

  log('Interrupting the kernel');
  await kernel.interrupt();

  log('Send an completion message');
  const reply = await kernel.requestComplete({ code: 'impor', cursor_pos: 4 });
  if (reply.content.status === 'ok') {
    log(reply.content.matches);
  }

  log('Restarting kernel');
  await kernel.restart();

  log('Shutting down kernel');
  await kernel.shutdown();

  log('Finding all existing kernels');
  const kernelModels = await KernelAPI.listRunning();
  log(kernelModels);
  if (kernelModels.length > 0) {
    log(`Connecting to ${kernelModels[0].name}`);
    kernelManager.connectTo({ model: kernelModels[0] });
  }
}


text:
package com.fsck.k9.helper;

import android.content.ContentResolver;
import android.content.ContentUris;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.provider.ContactsContract;
import timber.log.Timber;

import com.fsck.k9.K9;
import com.fsck.k9.mail.Address;

/**
 * Helper class to access the contacts stored on the device.
 */
public class Contacts {
    /**
     * The order in which the search results are returned by
     * {@link #getContactByAddress(String)}.
     */
    protected static final String SORT_ORDER =
            ContactsContract.CommonDataKinds.Email.TIMES_CONTACTED + " DESC, " +
                    ContactsContract.Contacts.DISPLAY_NAME + ", " +
                    ContactsContract.CommonDataKinds.Email._ID;

    /**
     * Array of columns to load from the database.
     */
    protected static final String PROJECTION[] = {
            ContactsContract.CommonDataKinds.Email._ID,
            ContactsContract.Contacts.DISPLAY_NAME,
            ContactsContract.CommonDataKinds.Email.CONTACT_ID
    };

    /**
     * Index of the name field in the projection. This must match the order in
     * {@link #PROJECTION}.
     */
    protected static final int NAME_INDEX = 1;

    /**
     * Index of the contact id field in the projection. This must match the order in
     * {@link #PROJECTION}.
     */
    protected static final int CONTACT_ID_INDEX = 2;

    /**
     * Get instance of the Contacts class.
     *
     *
Note: This is left over from the days when we needed to have SDK-specific code to access
     * the contacts.

     *
     * @param context A {@link Context} instance.
     * @return Appropriate {@link Contacts} instance for this device.
     */
    public static Contacts getInstance(Context context) {
        return new Contacts(context);
    }

    protected Context mContext;
    protected ContentResolver mContentResolver;

    /**
     * Constructor
     *
     * @param context A {@link Context} instance.
     */
    protected Contacts(Context context) {
        mContext = context;
        mContentResolver = context.getContentResolver();
    }

    /**
     * Start the activity to add information to an existing contact or add a
     * new one.
     *
     * @param email An {@link Address} instance containing the email address
     *              of the entity you want to add to the contacts. Optionally
     *              the instance also contains the (display) name of that
     *              entity.
     */
    public void createContact(final Address email) {
        final Uri contactUri = Uri.fromParts("mailto", email.getAddress(), null);

        final Intent contactIntent = new Intent(ContactsContract.Intents.SHOW_OR_CREATE_CONTACT);
        contactIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        contactIntent.setData(contactUri);

        // Pass along full E-mail string for possible create dialog
        contactIntent.putExtra(ContactsContract.Intents.EXTRA_CREATE_DESCRIPTION,
                email.toString());

        // Only provide personal name hint if we have one
        final String senderPersonal = email.getPersonal();
        if (senderPersonal != null) {
            contactIntent.putExtra(ContactsContract.Intents.Insert.NAME, senderPersonal);
        }

        mContext.startActivity(contactIntent);
    }

    /**
     * Start the activity to add a phone number to an existing contact or add a new one.
     *
     * @param phoneNumber
     *         The phone number to add to a contact, or to use when creating a new contact.
     */
    public void addPhoneContact(final String phoneNumber) {
        Intent addIntent = new Intent(Intent.ACTION_INSERT_OR_EDIT);
        addIntent.setType(ContactsContract.Contacts.CONTENT_ITEM_TYPE);
        addIntent.putExtra(ContactsContract.Intents.Insert.PHONE, Uri.decode(phoneNumber));
        addIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        mContext.startActivity(addIntent);
    }

    /**
     * Check whether the provided email address belongs to one of the contacts.
     *
     * @param emailAddress The email address to look for.
     * @return <tt>true</tt>, if the email address belongs to a contact.
     *         <tt>false</tt>, otherwise.
     */
    public boolean isInContacts(final String emailAddress) {
        boolean result = false;

        final Cursor c = getContactByAddress(emailAddress);

        if (c != null) {
            if (c.getCount() > 0) {
                result = true;
            }
            c.close();
        }

        return result;
    }

    /**
     * Check whether one of the provided addresses belongs to one of the contacts.
     *
     * @param addresses The addresses to search in contacts
     * @return <tt>true</tt>, if one address belongs to a contact.
     *         <tt>false</tt>, otherwise.
     */
    public boolean isAnyInContacts(final Address[] addresses) {
        if (addresses == null) {
            return false;
        }

        for (Address addr : addresses) {
            if (isInContacts(addr.getAddress())) {
                return true;
            }
        }
        return false;
    }

    /**
     * Get the name of the contact an email address belongs to.
     *
     * @param address The email address to search for.
     * @return The name of the contact the email address belongs to. Or
     *      <tt>null</tt> if there's no matching contact.
     */
    public String getNameForAddress(String address) {
        if (address == null) {
            return null;
        }

        final Cursor c = getContactByAddress(address);

        String name = null;
        if (c != null) {
            if (c.getCount() > 0) {
                c.moveToFirst();
                name = c.getString(NAME_INDEX);
            }
            c.close();
        }

        return name;
    }

    /**
     * Mark contacts with the provided email addresses as contacted.
     *
     * @param addresses Array of {@link Address} objects describing the
     *        contacts to be marked as contacted.
     */
    public void markAsContacted(final Address[] addresses) {
        //TODO: Optimize! Potentially a lot of database queries
        for (final Address address : addresses) {
            final Cursor c = getContactByAddress(address.getAddress());

            if (c != null) {
                if (c.getCount() > 0) {
                    c.moveToFirst();
                    final long personId = c.getLong(CONTACT_ID_INDEX);
                    ContactsContract.Contacts.markAsContacted(mContentResolver, personId);
                }
                c.close();
            }
        }
    }

    /**
     * Creates the intent necessary to open a contact picker.
     *
     * @return The intent necessary to open a contact picker.
     */
    public Intent contactPickerIntent() {
        return new Intent(Intent.ACTION_PICK, ContactsContract.CommonDataKinds.Email.CONTENT_URI);
    }

    /**
     * Get URI to the picture of the contact with the supplied email address.
     *
     * @param address
     *         An email address. The contact database is searched for a contact with this email
     *         address.
     *
     * @return URI to the picture of the contact with the supplied email address. {@code null} if
     *         no such contact could be found or the contact doesn't have a picture.
     */
    public Uri getPhotoUri(String address) {
        Long contactId;
        try {
            final Cursor c = getContactByAddress(address);
            if (c == null) {
                return null;
            }

            try {
                if (!c.moveToFirst()) {
                    return null;
                }

                contactId = c.getLong(CONTACT_ID_INDEX);
            } finally {
                c.close();
            }

            Cursor cur = mContentResolver.query(
                    ContactsContract.Data.CONTENT_URI,
                    null,
                    ContactsContract.Data.CONTACT_ID + "=" + contactId + " AND "
                            + ContactsContract.Data.MIMETYPE + "='"
                            + ContactsContract.CommonDataKinds.Photo.CONTENT_ITEM_TYPE + "'", null,
                    null);
            if (cur == null) {
                return null;
            }
            if (!cur.moveToFirst()) {
                cur.close();
                return null; // no photo
            }
            // Ok, they have a photo
            cur.close();
            Uri person = ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI, contactId);
            return Uri.withAppendedPath(person, ContactsContract.Contacts.Photo.CONTENT_DIRECTORY);
        } catch (Exception e) {
            Timber.e(e, "Couldn't fetch photo for contact with email %s", address);
            return null;
        }
    }

    /**
     * Return a {@link Cursor} instance that can be used to fetch information
     * about the contact with the given email address.
     *
     * @param address The email address to search for.
     * @return A {@link Cursor} instance that can be used to fetch information
     *         about the contact with the given email address
     */
    private Cursor getContactByAddress(final String address) {
        final Uri uri = Uri.withAppendedPath(ContactsContract.CommonDataKinds.Email.CONTENT_LOOKUP_URI, Uri.encode(address));
        final Cursor c = mContentResolver.query(
                uri,
                PROJECTION,
                null,
                null,
                SORT_ORDER);
        return c;
    }

}


text:
package com.spectralogic.dsbrowser.integration;

import com.spectralogic.ds3client.Ds3Client;
import com.spectralogic.ds3client.Ds3ClientBuilder;
import com.spectralogic.ds3client.models.JobRequestType;
import com.spectralogic.ds3client.utils.ResourceUtils;
import com.spectralogic.dsbrowser.gui.services.BuildInfoServiceImpl;
import com.spectralogic.dsbrowser.gui.services.jobinterruption.FilesAndFolderMap;
import com.spectralogic.dsbrowser.gui.services.jobinterruption.JobIdsModel;
import com.spectralogic.dsbrowser.gui.services.jobinterruption.JobInterruptionStore;
import com.spectralogic.dsbrowser.gui.services.newSessionService.SessionModelService;
import com.spectralogic.dsbrowser.gui.services.savedSessionStore.SavedCredentials;
import com.spectralogic.dsbrowser.gui.services.savedSessionStore.SavedSession;
import com.spectralogic.dsbrowser.gui.services.sessionStore.Session;
import com.spectralogic.dsbrowser.gui.services.tasks.CreateConnectionTask;
import com.spectralogic.dsbrowser.gui.util.ConfigProperties;
import com.spectralogic.dsbrowser.gui.util.ParseJobInterruptionMap;
import com.spectralogic.dsbrowser.gui.util.StringConstants;
import javafx.application.Platform;
import javafx.embed.swing.JFXPanel;
import org.controlsfx.control.TaskProgressView;
import org.junit.BeforeClass;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.file.Path;
import java.util.*;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

public class ParseJobInterruptionMapTest {
    private final static Logger LOG = LoggerFactory.getLogger(ParseJobInterruptionMapTest.class);

    private static Session session;
    private static String endpoint;
    private static File file;

    private static final UUID jobId = UUID.randomUUID();
    private static JobInterruptionStore jobInterruptionStore;
    private boolean successFlag = false;
    private final static ResourceBundle resourceBundle = ResourceBundle.getBundle("lang", new Locale(ConfigProperties.getInstance().getLanguage()));
    private static final Ds3Client client = Ds3ClientBuilder.fromEnv().withHttps(false).build();
    private static final BuildInfoServiceImpl buildInfoService = new BuildInfoServiceImpl();

    @BeforeClass
    public static void setUp() throws InterruptedException {
        final CountDownLatch latch = new CountDownLatch(1);
        new JFXPanel();
        Platform.runLater(() -> {
            try {
                //Initiating session
                final SavedSession savedSession = new SavedSession(
                        "Ds3PutJobTest",
                        client.getConnectionDetails().getEndpoint(),
                        "80",
                        null,
                        new SavedCredentials(
                                client.getConnectionDetails().getCredentials().getClientId(),
                                client.getConnectionDetails().getCredentials().getKey()),
                        false,
                        false);
                session = CreateConnectionTask.createConnection(SessionModelService.setSessionModel(savedSession, false), resourceBundle, buildInfoService);

                //Initializing endpoint
                endpoint = session.getEndpoint() + StringConstants.COLON + session.getPortNo();

                //Loading resource file
                final Path path;
                try {
                    path = ResourceUtils.loadFileResource("files/SampleFiles.txt");
                    ParseJobInterruptionMapTest.file = path.toFile();
                } catch (final URISyntaxException | FileNotFoundException e) {
                    e.printStackTrace();
                    fail();
                }
                final Map<String, Path> filesMap = new HashMap<>();
                filesMap.put("SampleFiles.txt", file.toPath());

                //Storing a interrupted job into resource file
                final FilesAndFolderMap filesAndFolderMap = new FilesAndFolderMap(filesMap, new HashMap<>(), JobRequestType.PUT.toString(), "2/03/2017 17:26:31", false, "additional", 2567L, "demo");
                final Map<String, FilesAndFolderMap> jobIdMap = new HashMap<>();
                jobIdMap.put(jobId.toString(), filesAndFolderMap);
                final Map<String, Map<String, FilesAndFolderMap>> endPointMap = new HashMap<>();
                endPointMap.put(session.getEndpoint() + StringConstants.COLON + session.getPortNo(), jobIdMap);
                final ArrayList<Map<String, Map<String, FilesAndFolderMap>>> endpointMapList = new ArrayList<>();
                endpointMapList.add(endPointMap);
                final JobIdsModel jobIdsModel = new JobIdsModel(endpointMapList);
                final JobInterruptionStore jobInterruptionStore1 = new JobInterruptionStore(jobIdsModel);
                jobInterruptionStore1.saveJobInterruptionStore(jobInterruptionStore1);
                jobInterruptionStore = JobInterruptionStore.loadJobIds();
            } catch (final IOException e) {
                e.printStackTrace();
                latch.countDown();
            }
        });
        latch.await(5, TimeUnit.SECONDS);
    }

    @Test
    public void saveValuesToFiles() throws InterruptedException {
        final CountDownLatch latch = new CountDownLatch(1);
        Platform.runLater(() -> {
            try {
                final Map<String, Path> filesMap = new HashMap<>();
                filesMap.put("demoFile.txt", file.toPath());

                //Creating jobIdMap
                final FilesAndFolderMap filesAndFolderMap = new FilesAndFolderMap(filesMap, new HashMap<>(), JobRequestType.PUT.toString(), "2/03/2017 17:26:31", false, "additional", 2567L, "demo");
                final Map<String, FilesAndFolderMap> jobIdMap = new HashMap<>();
                jobIdMap.put(jobId.toString(), filesAndFolderMap);
                final Map<String, Map<String, FilesAndFolderMap>> endPointMap = new HashMap<>();
                endPointMap.put(session.getEndpoint() + ":" + session.getPortNo(), jobIdMap);

                //Getting endpoints
                final ArrayList<Map<String, Map<String, FilesAndFolderMap>>> endpointMapList = new ArrayList<>();
                endpointMapList.add(endPointMap);
                final JobIdsModel jobIdsModel = new JobIdsModel(endpointMapList);
                final JobInterruptionStore jobInterruptionStore1 = new JobInterruptionStore(jobIdsModel);
                jobInterruptionStore1.saveJobInterruptionStore(jobInterruptionStore1);
                final JobInterruptionStore jobInterruptionStore = JobInterruptionStore.loadJobIds();

                //Getting updated endpoints
                final Optional<Map<String, Map<String, FilesAndFolderMap>>> endPointsMapElement = jobInterruptionStore.getJobIdsModel()
                        .getEndpoints().stream().filter(endpoint -> endpoint.containsKey(session.getEndpoint() + StringConstants
                                .COLON + session.getPortNo())).findFirst();
                if(endPointsMapElement.isPresent()) {
                    final Map<String, Map<String, FilesAndFolderMap>> endPointsMap = endPointsMapElement.get();
                    final Map<String, FilesAndFolderMap> stringFilesAndFolderMapMap = endPointsMap.get(session.getEndpoint() + StringConstants.COLON + session.getPortNo());
                    final Optional<String> jobIdKeyElement = stringFilesAndFolderMapMap.entrySet().stream()
                            .map(Map.Entry::getKey).filter(uuidKey -> uuidKey.equals(jobId.toString()))
                            .findFirst();
                    if (jobIdKeyElement.isPresent() && jobIdKeyElement.get().equals(jobId.toString())) {
                        successFlag = true;
                    }
                }
                else {
                    LOG.error("No interrupted job present");
                }
                latch.countDown();
            } catch (final IOException e) {
                e.printStackTrace();
                latch.countDown();
            }

        });
        latch.await();
        assertTrue(successFlag);
    }

    @Test
    public void getJobIDMap() throws InterruptedException {
        final CountDownLatch latch = new CountDownLatch(1);
        Platform.runLater(() -> {
            final Map<String, FilesAndFolderMap> jobIDMap = ParseJobInterruptionMap.getJobIDMap(
                    jobInterruptionStore.getJobIdsModel().getEndpoints(), endpoint,
                    new TaskProgressView<>(), null);
            final Map<String, Map<String, FilesAndFolderMap>> filesAndFolderMap1 = jobInterruptionStore
                    .getJobIdsModel()
                    .getEndpoints().get(0);

            //Get root key of interrupted jobs id map
            final Optional<String> resultMapKayElement = filesAndFolderMap1.entrySet().stream()
                    .map(Map.Entry::getKey)
                    .findFirst();
            boolean result = true;

            //Check if all keys/jobs id are equal
            if (!resultMapKayElement.isPresent() || (jobIDMap.size() != filesAndFolderMap1.get(resultMapKayElement.get()).size())) {
                result = false;
            } else {
                for (final String key : jobIDMap.keySet()) {
                    if (!jobIDMap.get(key).equals(filesAndFolderMap1.get(resultMapKayElement.get()).get(key))) {
                        result = false;
                    }
                }
            }
            successFlag = result;
            latch.countDown();
        });
        latch.await();
        assertTrue(successFlag);
    }

    @Test
    public void removeJobIdFromFile() throws InterruptedException {
        final CountDownLatch latch = new CountDownLatch(1);
        Platform.runLater(() -> {
            final Map<String, Path> filesMap = new HashMap<>();
            filesMap.put("demoFile.txt", file.toPath());

                //Creating jobIdMap
                final FilesAndFolderMap filesAndFolderMap = new FilesAndFolderMap(filesMap, new HashMap<>(), JobRequestType.PUT.toString(), "2/03/2017 17:26:31", false, "additional", 2567L, "demo");
                final Map<String, FilesAndFolderMap> jobIdMap = new HashMap<>();
                jobIdMap.put(jobId.toString(), filesAndFolderMap);
                final Map<String, Map<String, FilesAndFolderMap>> endPointMap = new HashMap<>();
                endPointMap.put(session.getEndpoint() + ":" + session.getPortNo(), jobIdMap);
                final ArrayList<Map<String, Map<String, FilesAndFolderMap>>> endpointMapList = new ArrayList<>();
                endpointMapList.add(endPointMap);

            //Saving an interrupted job to file to make method independent
            final JobIdsModel jobIdsModel = new JobIdsModel(endpointMapList);
            final JobInterruptionStore jobInterruptionStore1 = new JobInterruptionStore(jobIdsModel);
            try {
                JobInterruptionStore.saveJobInterruptionStore(jobInterruptionStore1);
                jobInterruptionStore = JobInterruptionStore.loadJobIds();
            } catch (final IOException e) {
                e.printStackTrace();
                fail();
            }

            final Optional<Map<String, Map<String, FilesAndFolderMap>>> endPointsMapElement = jobInterruptionStore.getJobIdsModel()
                    .getEndpoints().stream().filter(endpoint1 -> endpoint1.containsKey(session.getEndpoint() +
                            StringConstants.COLON + session.getPortNo())).findFirst();

            //Getting jobId which to be removed
            if(endPointsMapElement.isPresent()) {
                final Map<String, Map<String, FilesAndFolderMap>> endPointsMap = endPointsMapElement.get();
                final Optional<String> resultMapKayElement = endPointsMapElement.get().entrySet().stream()
                        .map(Map.Entry::getKey)
                        .findFirst();
                if (resultMapKayElement.isPresent()) {
                    final Optional<String> jobIdToBeRemovedElement = endPointsMap.get(resultMapKayElement.get()).entrySet().stream()
                            .map(Map.Entry::getKey)
                            .findFirst();
                    if (jobIdToBeRemovedElement.isPresent()) {
                        //Removing job from file
                        try {
                            ParseJobInterruptionMap.removeJobIdFromFile(jobInterruptionStore, jobIdToBeRemovedElement.get(), session.getEndpoint() + StringConstants.COLON + session.getPortNo());
                        } catch (final IOException e) {
                            e.printStackTrace();
                            fail();
                        }

                        final boolean isJobPresent = readNewJobId();
                        //Validating test case
                        if (!isJobPresent) {
                            successFlag = true;
                        }
                    }
                }
            }
            latch.countDown();
        });
        latch.await();
        assertTrue(successFlag);
    }

    private boolean readNewJobId() {
        try {
            jobInterruptionStore = JobInterruptionStore.loadJobIds();
        } catch (final IOException e) {
            e.printStackTrace();
            fail();
        }

        final Optional<Map<String, Map<String, FilesAndFolderMap>>> endPointsMapNewelement = jobInterruptionStore
                .getJobIdsModel()
                .getEndpoints().stream().filter(endpoint1 -> endpoint1.containsKey(session.getEndpoint() +
                        StringConstants
                                .COLON + session.getPortNo())).findFirst();
        if(endPointsMapNewelement.isPresent()) {
            final Optional<String> resultMapKayNewElement = endPointsMapNewelement.get().entrySet().stream()
                    .map(Map.Entry::getKey)
                    .findFirst();

            if (resultMapKayNewElement.isPresent()) {
                final Optional<String> jobIdToBeRemovedNewElement = endPointsMapNewelement.get().get(resultMapKayNewElement.get()).entrySet().stream()
                        .map(Map.Entry::getKey)
                        .findFirst();
                return jobIdToBeRemovedNewElement.isPresent();
            }
        }
        return true;

    }
}


text:
package com.marklogic.hub.web.model;

import com.marklogic.hub.legacy.flow.CodeFormat;
import com.marklogic.hub.legacy.flow.DataFormat;
import com.marklogic.hub.legacy.flow.FlowType;

import java.util.ArrayList;
import java.util.List;

public class FlowModel {

    public String entityName;
    public String flowName;
    public FlowType flowType;
    public CodeFormat codeFormat;
    public DataFormat dataFormat;
    public Boolean useEsModel;
    public String mappingName;
    public List<PluginModel> plugins = new ArrayList<>();

    public FlowModel() {}

    public FlowModel(String entityName, String flowName) {
        this.entityName = entityName;
        this.flowName = flowName;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        sb.append("entityName=");
        sb.append(entityName);
        sb.append("flowName=");
        sb.append(flowName);
        sb.append("flowType=");
        sb.append(flowType.toString());
        sb.append("codeFormat=");
        sb.append(codeFormat.toString());
        sb.append("dataFormat=");
        sb.append(dataFormat.toString());
        sb.append("mappingName=");
        sb.append(mappingName);
        sb.append("}");

        return sb.toString();
    }
}


text:
package com.blm.test;

import java.io.IOException;
import java.net.URI;
import java.text.SimpleDateFormat;
import java.util.Date;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.Writable;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.input.TextInputFormat;
import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
import org.apache.hadoop.util.GenericOptionsParser;

import com.blm.orc.OrcFile;
import com.blm.orc.OrcInputFormat;
import com.blm.orc.OrcNewInputFormat;
import com.blm.orc.OrcNewInputFormat.OrcRecordReader;
import com.blm.orc.OrcNewOutputFormat;
import com.blm.orc.OrcStruct;
import com.blm.orc.Reader;

/**
 * @author thinkpad
 *
 */
public class OrcTest {

	String time = new SimpleDateFormat("yyyy-MM-ddHHmmss").format(new Date());

	/**
	 * 遍历指定文件一定范围内的数据
	 */
	public void readOrcFile() throws IOException, InterruptedException  {
		String input = "hdfs://192.168.129.63:9000/test/tout.orc/part-r-00000";
		Configuration conf = new Configuration();
		Path fileIn = new Path(input);
		Reader r = OrcFile.createReader(FileSystem.get(URI.create(input), conf), fileIn);

		OrcRecordReader reader = new OrcRecordReader(r, conf, 0, 753); //0-300表示orcfile长度
		if ( reader!=null ) {
			//获得文件的列数
			System.out.println("========record counts : " + reader.getNumColumns());
		}

//		read

		while( reader.nextKeyValue() ) {
			OrcStruct data = reader.getCurrentValue();
			System.out.println("fields: " + data.getNumFields());
			for(int i = 0; i < data.getNumFields(); i++){
				System.out.print(data.getFieldValue(i)+" , ");
			}
			System.out.println("");
		}
	}

	/**
	 * 生成指定路径的orc文件
	 */
	public void createOrcFile() throws IOException, InterruptedException {
		//		String input = "/test/orcOut.orc";
		//		Configuration conf = new Configuration();
		//		Path fileIn = new Path(input);
		//
		//		for( int i = 0; i < 1000; i++ ) {
		//
		//		}

	}

	public void testTextMR() throws IOException, InterruptedException, ClassNotFoundException {
		Configuration conf = new Configuration();
		Job job = new Job(conf, "testTextMR");

		//		FileSystem fs = FileSystem.get(conf);
		//		if ( fs.exists(new Path("hdfs://192.168.129.63:9000/test/ttt2.txt")) ) {
		//			fs.delete(new Path("hdfs://192.168.129.63:9000/test/ttt2.txt"), true);
		//		}

		job.setJarByClass(OrcTest.class);
		//配置map和reduce
		job.setMapperClass(TestMapper.class);
		job.setReducerClass(TestReducer.class);
		//配置输出的<key,value>
		job.setOutputKeyClass(Text.class);
		job.setOutputValueClass(IntWritable.class);
		//配置inputformat,outputformat
		job.setInputFormatClass(TextInputFormat.class);
		job.setOutputFormatClass(TextOutputFormat.class);
		//配置输入输出路径
		FileInputFormat.addInputPath(job, new Path("hdfs://192.168.129.63:9000/test/ttt1.txt"));
		FileOutputFormat.setOutputPath(job, new Path("hdfs://192.168.129.63:9000/test/tttout"+time));
		System.exit(job.waitForCompletion(true) ? 0 : 1);  //执行job
		System.out.println("ok");

	}

	/**
	 * text -> ORC 的MR demo
	 * @throws IOException
	 * @throws InterruptedException
	 * @throws ClassNotFoundException
	 *
	 * @author LiaoZhuo
	 */
	public void testOrcMR() throws IOException, InterruptedException, ClassNotFoundException {
		Configuration conf = new Configuration();
		Job job = new Job(conf, "word count");

		//		FileSystem fs = FileSystem.get(conf);
		//		if ( fs.exists(new Path("/test/tout.orc")) ) {
		//			fs.delete(new Path("/test/tout.orc"), true);
		//		}

		job.setJarByClass(OrcTest.class);
		//配置map和reduce
		job.setMapperClass(TestOrcMapper.class);
		job.setMapOutputKeyClass(Text.class);
		job.setMapOutputValueClass(IntWritable.class);
		job.setReducerClass(TestOrcReducer.class);
		//配置输出的<key,value>
		job.setOutputKeyClass(NullWritable.class);
		job.setOutputValueClass(Writable.class);
		//配置inputformat,outputformat
		job.setInputFormatClass(TextInputFormat.class);
		job.setOutputFormatClass(OrcNewOutputFormat.class);
		//配置输入输出路径
		FileInputFormat.addInputPath(job, new Path("hdfs://192.168.129.63:9000/test/ttt1.txt"));

		OrcNewOutputFormat.setCompressOutput(job,true);
		OrcNewOutputFormat.setOutputPath(job,new Path("hdfs://192.168.129.63:9000/test/torc"+time));

		System.exit(job.waitForCompletion(true) ? 0 : 1);  //执行job
		System.out.println("ok");
	}

	/**
	 * ORC->text 的 MR demo
	 * @throws IOException
	 * @throws InterruptedException
	 * @throws ClassNotFoundException
	 *
	 * @author DamianZhou
	 */
	public void testGetOrcMR() throws IOException, InterruptedException, ClassNotFoundException {
		Configuration conf = new Configuration();

		//无效:为控制压缩格式
		//		conf.setBoolean("mapred.output.compress", false);

		Job job = new Job(conf, "word count");

		//		FileSystem fs = FileSystem.get(conf);
		//		if ( fs.exists(new Path("/test/tout.orc")) ) {
		//			fs.delete(new Path("/test/tout.orc"), true);
		//		}

		job.setJarByClass(OrcTest.class);

		//配置map和reduce
		job.setMapperClass(TestGetOrcMapper.class);
		job.setReducerClass(TestGetOrcReducer.class);

		job.setMapOutputKeyClass(Text.class);
		job.setMapOutputValueClass(IntWritable.class);

		//配置输出的<key,value>
		job.setOutputKeyClass(Text.class);
		job.setOutputValueClass(IntWritable.class);

		//配置inputformat,outputformat
		job.setInputFormatClass(OrcNewInputFormat.class);
		job.setOutputFormatClass(TextOutputFormat.class);

		//配置输入输出路径
		FileInputFormat.addInputPath(job, new Path("hdfs://192.168.129.63:9000/test/tout.orc/part-r-00000"));

		OrcNewOutputFormat.setCompressOutput(job,true);
		OrcNewOutputFormat.setOutputPath(job,new Path("hdfs://192.168.129.63:9000/test/torc"+time));

		System.exit(job.waitForCompletion(true) ? 0 : 1);  //执行job
		System.out.println("ok");
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		OrcTest test = new OrcTest();
		try{
			//			test.testTextMR();
			//			test.testOrcMR();
			//			test.readOrcFile();
			test.testGetOrcMR();

		} catch ( Exception ex ) {
			ex.printStackTrace();
		}
	}

}


text:
<?php
namespace oasis\names\specification\ubl\schema\xsd\CommonBasicComponents_2;

/**
 * @xmlNamespace urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2
 * @xmlType UnitQuantityType
 * @xmlName UnitQuantity
 * @var oasis\names\specification\ubl\schema\xsd\CommonBasicComponents_2\UnitQuantity
 */
class UnitQuantity
	extends UnitQuantityType
	{

} // end class UnitQuantity