text:
// Copyright (c) Samuel Cragg.
//
// Licensed under the MIT license. See LICENSE file in the project root for
// full license information.

namespace Crest.DataAccess
{
    using System;
    using System.Linq.Expressions;
    using Crest.Core.Util;

    /// <summary>
    /// Provides information about to map between two types.
    /// </summary>
    public sealed class MappingInfo
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="MappingInfo"/> class.
        /// </summary>
        /// <param name="destination">The destination type.</param>
        /// <param name="source">The type of the source of data.</param>
        /// <param name="mapping">The expression with the mappings.</param>
        public MappingInfo(Type destination, Type source, Expression mapping)
        {
            Check.IsNotNull(destination, nameof(destination));
            Check.IsNotNull(mapping, nameof(mapping));
            Check.IsNotNull(source, nameof(source));

            this.Destination = destination;
            this.Source = source;
            this.Mapping = mapping;
        }

        /// <summary>
        /// Gets the type of the destination of the mapped values.
        /// </summary>
        public Type Destination { get; }

        /// <summary>
        /// Gets an expression that maps the members from the type represented
        /// by <see cref="Source"/> to the <see cref="Destination"/> type.
        /// </summary>
        public Expression Mapping { get; }

        /// <summary>
        /// Gets the type of the source of mapped values.
        /// </summary>
        public Type Source { get; }
    }
}


text:
using System.Collections.Generic;
using DSharpPlus.Entities;

namespace DSharpPlus.EventArgs
{
    /// <summary>
    /// Represents arguments for <see cref="DiscordClient.MessagesBulkDeleted"/> event.
    /// </summary>
    public class MessageBulkDeleteEventArgs : DiscordEventArgs
    {
        /// <summary>
        /// Gets a collection of the deleted messages.
        /// </summary>
        public IReadOnlyList<DiscordMessage> Messages { get; internal set; }

        /// <summary>
        /// Gets the channel in which the deletion occured.
        /// </summary>
        public DiscordChannel Channel { get; internal set; }

        internal MessageBulkDeleteEventArgs(DiscordClient client) : base(client) { }
    }
}

redpajama_set_name: RedPajamaGithub


text:
/**
 * Defines support rules of the ObjectMarker control of sap.m library.
 */
sap.ui.define(["sap/ui/support/library"],
	function(SupportLib) {
		"use strict";

		// shortcuts
		var Categories = SupportLib.Categories, // Accessibility, Performance, Memory, ...
			Severity = SupportLib.Severity, // Low, Medium, High
			Audiences = SupportLib.Audiences; // Control, Internal, Application

		//**********************************************************
		// Rule Definitions
		//**********************************************************

		/**
		 * Checks if the ObjectMarker sets type property when additionalInfo use used
		 */
		var oObjMarkerAdditionalInfoRule = {
			id : "objectMarkerAdditionalInfo",
			audiences: [Audiences.Control],
			categories: [Categories.Usage],
			enabled: true,
			minversion: "*",
			title: "ObjectMarker: additionalInfo property",
			description: "Checks if additionalInfo property is used but no type is set",
			resolution: "Set type of the ObjectMarker",
			resolutionurls: [{
				text: "API Reference: sap.m.ObjectMarker",
				href: "https://sdk.openui5.org/api/sap.m.ObjectMarker"
			}],
			check: function (oIssueManager, oCoreFacade, oScope) {
				oScope.getElementsByClassName("sap.m.ObjectMarker")
					.forEach(function(oElement) {

						var sElementId = oElement.getId(),
							sElementName = oElement.getMetadata().getElementName();

						if (oElement.getAdditionalInfo() && !oElement.getType()) {
							oIssueManager.addIssue({
								severity: Severity.Medium,
								details: "ObjectMarker '" + sElementName + "' (" + sElementId + ") sets additionalInfo but has no type.",
								context: {
									id: sElementId
								}
							});
						}
					});
			}
		};

		return [
			oObjMarkerAdditionalInfoRule
		];

	}, true);


text:
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.

ARROW_DIR="${SOURCE_DIR}/../.."

update_versions() {
  local base_version=$1
  local next_version=$2
  local type=$3

  case ${type} in
    release)
      local version=${base_version}
      local r_version=${base_version}
      ;;
    snapshot)
      local version=${next_version}-SNAPSHOT
      local r_version=${base_version}.9000
      ;;
  esac
  local major_version=${version%%.*}

  pushd "${ARROW_DIR}/c_glib"
  sed -i.bak -E -e \
    "s/^version = '.+'/version = '${version}'/" \
    meson.build
  rm -f meson.build.bak
  git add meson.build
  popd

  pushd "${ARROW_DIR}/ci/scripts"
  sed -i.bak -E -e \
    "s/^pkgver=.+/pkgver=${r_version}/" \
    PKGBUILD
  rm -f PKGBUILD.bak
  git add PKGBUILD
  popd

  pushd "${ARROW_DIR}/cpp"
  sed -i.bak -E -e \
    "s/^set\(ARROW_VERSION \".+\"\)/set(ARROW_VERSION \"${version}\")/" \
    CMakeLists.txt
  rm -f CMakeLists.txt.bak
  git add CMakeLists.txt

  sed -i.bak -E -e \
    "s/\"version-string\": \".+\"/\"version-string\": \"${version}\"/" \
    vcpkg.json
  rm -f vcpkg.json.bak
  git add vcpkg.json
  popd

  pushd "${ARROW_DIR}/java"
  mvn versions:set -DnewVersion=${version}
  find . -type f -name pom.xml.versionsBackup -delete
  git add "pom.xml"
  git add "**/pom.xml"
  popd

  pushd "${ARROW_DIR}/csharp"
  sed -i.bak -E -e \
    "s/^    <Version>.+<\/Version>/    <Version>${version}<\/Version>/" \
    Directory.Build.props
  rm -f Directory.Build.props.bak
  git add Directory.Build.props
  popd

  pushd "${ARROW_DIR}/dev/tasks/homebrew-formulae"
  sed -i.bak -E -e \
    "s/arrow-[0-9.]+[0-9]+/arrow-${r_version}/g" \
    autobrew/apache-arrow.rb
  rm -f autobrew/apache-arrow.rb.bak
  git add autobrew/apache-arrow.rb
  sed -i.bak -E -e \
    "s/arrow-[0-9.\-]+[0-9SNAPHOT]+/arrow-${version}/g" \
    apache-arrow-glib.rb \
    apache-arrow.rb
  rm -f \
    apache-arrow-glib.rb.bak \
    apache-arrow.rb.bak
  git add \
    apache-arrow-glib.rb \
    apache-arrow.rb
  popd

  pushd "${ARROW_DIR}/js"
  sed -i.bak -E -e \
    "s/^  \"version\": \".+\"/  \"version\": \"${version}\"/" \
    package.json
  rm -f package.json.bak
  git add package.json
  popd

  pushd "${ARROW_DIR}/matlab"
  sed -i.bak -E -e \
    "s/^set\(MLARROW_VERSION \".+\"\)/set(MLARROW_VERSION \"${version}\")/" \
    CMakeLists.txt
  rm -f CMakeLists.txt.bak
  git add CMakeLists.txt
  popd

  pushd "${ARROW_DIR}/python"
  sed -i.bak -E -e \
    "s/^default_version = '.+'/default_version = '${version}'/" \
    setup.py
  rm -f setup.py.bak
  git add setup.py
  popd

  pushd "${ARROW_DIR}/r"
  sed -i.bak -E -e \
    "s/^Version: .+/Version: ${r_version}/" \
    DESCRIPTION
  rm -f DESCRIPTION.bak
  git add DESCRIPTION
  # Replace dev version with release version
  sed -i.bak -E -e \
    "0,/^# arrow /s/^# arrow .+/# arrow ${base_version}/" \
    NEWS.md
  if [ ${type} = "snapshot" ]; then
    # Add a news entry for the new dev version
    sed -i.bak -E -e \
      "0,/^# arrow /s/^(# arrow .+)/# arrow ${r_version}\n\n\1/" \
      NEWS.md
  fi
  rm -f NEWS.md.bak
  git add NEWS.md
  popd

  pushd "${ARROW_DIR}/ruby"
  sed -i.bak -E -e \
    "s/^  VERSION = \".+\"/  VERSION = \"${version}\"/g" \
    */*/*/version.rb
  rm -f */*/*/version.rb.bak
  git add */*/*/version.rb
  popd

  pushd "${ARROW_DIR}/go"
  find . "(" -name "*.go*" -o -name "go.mod" ")" -exec sed -i.bak -E -e \
    "s|(github\\.com/apache/arrow/go)/v[0-9]+|\1/v${major_version}|" {} \;
  find . -name "*.bak" -exec rm {} \;
  git add .
  popd

  case ${type} in
    snapshot)
      pushd "${ARROW_DIR}"
      ${PYTHON:-python3} "dev/release/utils-update-docs-versions.py" . "${version}" "${r_version}"
      git add r/pkgdown/assets/versions.json
      git add docs/source/_static/versions.json
      popd
      ;;
  esac
}


text:
void DataFeeder::init()
{
    m_pLevel2Api->RegisterSpi(this);
    m_pLevel2Api->RegisterFront(const_cast<char*>(this->front_address.c_str()));
    // 使客户端开始与后台服务建立连接
    m_pLevel2Api->Init();
}

void DataFeeder::OnFrontConnected()
{
	CThostFtdcReqUserLoginField reqUserLogin;
	memset(&reqUserLogin, 0, sizeof(reqUserLogin));
    strcpy(reqUserLogin.BrokerID, this->brokerID.c_str());
    strcpy(reqUserLogin.UserID, this->userID.c_str());
    strcpy(reqUserLogin.Password, this->passwd.c_str());
    m_pLevel2Api->ReqUserLogin(&reqUserLogin, 0);
}

void DataFeeder::OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
{
    std::cout << "OnRspUserLogin:\t" << "ErrorCode=[" << pRspInfo->ErrorID << "], ErrorMsg=[" << pRspInfo->ErrorMsg << "]" << std::endl;
    if (pRspInfo->ErrorID != 0)
        std::cout << "Error: Login Error!" << std::endl;
}

void DataFeeder::subscrib_L2_market_data(std::string stockid)
{
	CThostFtdcSpecificSecurityField query;
	memset(&query, 0, sizeof(query));
	std::string security_id = stockid.substr(2);
	std::string exchange_id = this->ExchangeIDDict[ stockid.substr(0,2) ];
	strcpy(query.SecurityID, security_id.c_str());
	strcpy(query.ExchangeID, exchange_id.c_str());

	m_pLevel2Api->SubscribeLevel2MarketData(&query, 1);
}

void DataFeeder::OnRtnLevel2MarketData(CThostFtdcLevel2MarketDataField *pLevel2MarketData)
{
	std::ostringstream oss;
	CThostFtdcLevel2MarketDataField *p = pLevel2MarketData;
	std::string stockid = this->ExchangeIDDict_Reverse[p->ExchangeID] + p->SecurityID;

	oss << stockid << ',' << p->OpenPx << ',' << p->PreClosePx << ',' << p->LastPx << ',' << p->HighPx << ',' << p->LowPx << ','
		<< p->TotalVolumeTrade << ',' << p->TotalValueTrade << ','
		<< p->BidPx1 << ',' << p->BidOrderQty1 << ',' << p->BidPx2 << ',' << p->BidOrderQty2 << ',' << p->BidPx3 << ',' << p->BidOrderQty3 << ','
		<< p->OfferPx1 << ',' << p->OfferOrderQty1 << ',' << p->OfferPx2 << ',' << p->OfferOrderQty2 << ',' << p->OfferPx3 << ',' << p->OfferOrderQty3 << ','
		<< p->TradingDay << ',' << p->DataTimeStamp;

	stock_datas[stockid] = oss.str();
//	std::cout << stock_datas[stockid] << std::endl;
}

std::string DataFeeder::get_L2_market_data(std::string stockid)
{
	return this->stock_datas[stockid];
}


text:
package org.jboss.dcp.api.service;

import java.util.logging.Logger;

import org.elasticsearch.client.Client;
import org.jboss.dcp.api.testtools.ESRealClientTestBase;
import org.junit.Test;
import org.mockito.Mockito;

/**
 * Unit tests for {@link SearchService} against real embedded ElasticSearch client.
 *
 * @author Vlastimil Elias (velias at redhat dot com)
 */
public class SearchServiceTest_ESRealClient extends ESRealClientTestBase {

	@Test
	public void filterContributor() {
		Client client = prepareESClientForUnitTest();
		try {
			@SuppressWarnings("unused")
			SearchService tested = getTested(client);
			prepareTestData(client);

			// TODO _SEARCH unit test against real embedded ElasticSearch client.

		} finally {
			finalizeESClientForUnitTest();
		}
	}

	private void prepareTestData(Client client) {
		// TODO _SEARCH unit test against real embedded ElasticSearch client.
	}

	private SearchService getTested(Client client) {
		SearchService tested = new SearchService();
		tested.searchClientService = Mockito.mock(SearchClientService.class);
		Mockito.when(tested.searchClientService.getClient()).thenReturn(client);
		tested.providerService = Mockito.mock(ProviderService.class);
		tested.log = Logger.getLogger("testlogger");
		return tested;
	}

}


text:
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Net;
using System.Net.Sockets;
using System.IO;
using Microsoft.Spark.CSharp.Sql;
using Razorvine.Pickle;
using Microsoft.Spark.CSharp.Proxy;

namespace AdapterTest.Mocks
{
    internal class MockDataFrameProxy : IDataFrameProxy
    {
        internal object[] mockDataFrameReference;
        private ISqlContextProxy mockSqlContextProxy;
        private List<object> mockRows;
        private int mockPort;
        private IStructTypeProxy mockSchema;

        public ISqlContextProxy SqlContextProxy
        {
            get { return mockSqlContextProxy; }
        }

        //just saving the parameter collection to mock the proxy reference that will be used in Assert statements
        internal MockDataFrameProxy(object[] parameterCollection, ISqlContextProxy scProxy)
        {
            mockDataFrameReference = parameterCollection;
            mockSqlContextProxy = scProxy;
        }

        // prepare data for mock CollectAndServe()
        // input data is List of Rows and each row is modeled as array of columns
        internal MockDataFrameProxy(int port, List<object> rows, IStructTypeProxy schema)
        {
            mockPort = port;
            mockRows = rows;
            mockSchema = schema;
        }

        public void RegisterTempTable(string tableName)
        {
            throw new NotImplementedException();
        }

        public long Count()
        {
            throw new NotImplementedException();
        }

        public string GetQueryExecution()
        {
            throw new NotImplementedException();
        }

        public string GetExecutedPlan()
        {
            throw new NotImplementedException();
        }

        public string GetShowString(int numberOfRows, bool truncate)
        {
            throw new NotImplementedException();
        }

        bool IDataFrameProxy.IsLocal()
        {
            throw new NotImplementedException();
        }

        public IStructTypeProxy GetSchema()
        {
            return mockSchema;
        }

        public IRDDProxy ToJSON()
        {
            throw new NotImplementedException();
        }

        public IRDDProxy ToRDD()
        {
            throw new NotImplementedException();
        }

        public IColumnProxy GetColumn(string columnName)
        {
            throw new NotImplementedException();
        }

        public IDataFrameProxy Select(string columnName, string[] columnNames)
        {
            throw new NotImplementedException();
        }

        public IDataFrameProxy Select(IEnumerable<IColumnProxy> columns)
        {
            throw new NotImplementedException();
        }

        public IDataFrameProxy SelectExpr(string[] columnExpressions)
        {
            throw new NotImplementedException();
        }

        public IDataFrameProxy Filter(string condition)
        {
            throw new NotImplementedException();
        }

        public IGroupedDataProxy GroupBy(string firstColumnName, string[] otherColumnNames)
        {
            throw new NotImplementedException();
        }

        public IGroupedDataProxy GroupBy()
        {
            throw new NotImplementedException();
        }

        public IGroupedDataProxy Rollup(string firstColumnName, string[] otherColumnNames)
        {
            throw new NotImplementedException();
        }

        public IGroupedDataProxy Cube(string firstColumnName, string[] otherColumnNames)
        {
            throw new NotImplementedException();
        }

        public IDataFrameProxy Agg(IGroupedDataProxy scalaGroupedDataReference, System.Collections.Generic.Dictionary<string, string> columnNameAggFunctionDictionary)
        {
            throw new NotImplementedException();
        }

        public IDataFrameProxy Join(IDataFrameProxy otherScalaDataFrameReference, string joinColumnName)
        {
            return new MockDataFrameProxy(new object[] { otherScalaDataFrameReference, joinColumnName }, SqlContextProxy);
        }

        public IDataFrameProxy Join(IDataFrameProxy otherScalaDataFrameReference, string[] joinColumnNames)
        {
            return new MockDataFrameProxy(new object[] { otherScalaDataFrameReference, joinColumnNames }, SqlContextProxy);
        }

        public IDataFrameProxy Join(IDataFrameProxy otherScalaDataFrameReference, IColumnProxy scalaColumnReference, string joinType)
        {
            return new MockDataFrameProxy(new object[] { otherScalaDataFrameReference, scalaColumnReference, joinType }, SqlContextProxy);
        }

        public bool IsLocal
        {
            get { throw new NotImplementedException(); }
        }

        public void Cache()
        {
            throw new NotImplementedException();
        }

        public void Persist(Microsoft.Spark.CSharp.Core.StorageLevelType storageLevelType)
        {
            throw new NotImplementedException();
        }

        public void Unpersist(bool blocking)
        {
            throw new NotImplementedException();
        }

        public IRDDProxy JavaToCSharp()
        {
            Pickler pickler = new Pickler();
            return new MockRddProxy(mockRows.Select(r => pickler.dumps(new object[] { r })), true);
        }

        public IDataFrameProxy Replace<T>(object subset, Dictionary<T, T> toReplaceAndValueDict)
        {
            throw new NotImplementedException();
        }

        public IEnumerable<IDataFrameProxy> RandomSplit(IEnumerable<double> weights, long? seed)
        {
            throw new NotImplementedException();
        }

        public IDataFrameProxy Sort(IColumnProxy[] columns)
        {
            throw new NotImplementedException();
        }

        public double Corr(string column1, string column2, string method)
        {
            throw new NotImplementedException();
        }

        public double Cov(string column1, string column2)
        {
            throw new NotImplementedException();
        }

        public IDataFrameProxy FreqItems(IEnumerable<string> columns, double support)
        {
            throw new NotImplementedException();
        }

        public IDataFrameProxy Crosstab(string column1, string column2)
        {
            throw new NotImplementedException();
        }

        public IDataFrameProxy Limit(int num)
        {
            throw new NotImplementedException();
        }

        public IDataFrameProxy Coalesce(int numPartitions)
        {
            throw new NotImplementedException();
        }

        public IDataFrameProxy Repartition(int numPartitions)
        {
            throw new NotImplementedException();
        }

        public IDataFrameProxy Distinct()
        {
            throw new NotImplementedException();
        }

        public IDataFrameProxy Sample(bool withReplacement, double fraction, long seed)
        {
            throw new NotImplementedException();
        }

        public IDataFrameWriterProxy Write()
        {
            throw new NotImplementedException();
        }

        public IDataFrameProxy Alias(string alias)
        {
            throw new NotImplementedException();
        }

        public IDataFrameProxy Describe(string[] columns)
        {
            throw new NotImplementedException();
        }

        public IGroupedDataProxy Rollup(IColumnProxy[] columns)
        {
            throw new NotImplementedException();
        }

        public IGroupedDataProxy Cube(IColumnProxy[] columns)
        {
            throw new NotImplementedException();
        }

        public IDataFrameProxy UnionAll(IDataFrameProxy other)
        {
            throw new NotImplementedException();
        }

        public IDataFrameProxy Intersect(IDataFrameProxy other)
        {
            throw new NotImplementedException();
        }

        public IDataFrameProxy Subtract(IDataFrameProxy other)
        {
            throw new NotImplementedException();
        }

        public IDataFrameProxy Drop(string columnName)
        {
            throw new NotImplementedException();
        }

        public IDataFrameProxy DropNa(int? thresh, string[] subset)
        {
            throw new NotImplementedException();
        }

        public IDataFrameNaFunctionsProxy Na()
        {
            throw new NotImplementedException();
        }

        public IDataFrameProxy DropDuplicates()
        {
            throw new NotImplementedException();
        }

        public IDataFrameProxy DropNa(string how, int? thresh, string[] subset)
        {
            throw new NotImplementedException();
        }

        public IDataFrameProxy Replace<T>(T toReplace, T value, string[] subset)
        {
            throw new NotImplementedException();
        }

        public IDataFrameProxy ReplaceAll<T>(IEnumerable<T> toReplace, IEnumerable<T> value, string[] subset)
        {
            throw new NotImplementedException();
        }

        public IDataFrameProxy ReplaceAll<T>(IEnumerable<T> toReplace, T value, string[] subset)
        {
            throw new NotImplementedException();
        }

        public IDataFrameProxy DropDuplicates(string[] subset)
        {
            throw new NotImplementedException();
        }

        public void Drop(IColumnProxy column)
        {
            throw new NotImplementedException();
        }

        public IDataFrameProxy Repartition(int numPartitions, IColumnProxy[] columns)
        {
            throw new NotImplementedException();
        }

        public IDataFrameProxy Repartition(IColumnProxy[] columns)
        {
            throw new NotImplementedException();
        }

        public IDataFrameProxy SortWithinPartitions(IColumnProxy[] columns)
        {
            throw new NotImplementedException();
        }
    }
}


text:
package jwebform.integration.fromBean;

import jwebform.Form;
import jwebform.field.TextType;
import jwebform.integration.bean2form.DefaultBean2Form;
import org.junit.Before;
import org.junit.Test;

import static junit.framework.TestCase.assertTrue;
import static org.junit.Assert.assertEquals;

// Tests if it works, to convert a bean containing a String to a form with a TextType field via Bean2Form
public class TestString {

  public static final String INITIAL_VALUE = "testname";
  Form form;

  @Before
  public void init() {
    Bean bean = new Bean();
    bean.name = INITIAL_VALUE;
    form = new DefaultBean2Form().getFormFromBean(bean);
  }

  @Test
  public void test_beanWithString() {
    assertEquals(form.getFields().size(), 1);
    assertTrue(form.getFields().get(0).fieldType instanceof TextType);
  }

  @Test
  public void test_beanNameCorrect() {
    TextType textType = (TextType)form.getFields().get(0).fieldType;
    assertEquals(textType.oneValueField.name, "name");
  }

  @Test
  public void test_presetCorrect() {
    TextType textType = (TextType)form.getFields().get(0).fieldType;
    assertEquals( INITIAL_VALUE, textType.oneValueField.initialValue);
  }

  public class Bean {
    public String name;
  }
}


text:
module RuboCop
  module Cop
    module Lint
      # This cop checks for conditions that are not on the same line as
      # if/while/until.
      #
      # @example
      #
      #   if
      #     some_condition
      #     do_something
      #   end
      class ConditionPosition < Cop
        def on_if(node)
          return if node.loc.respond_to?(:question)

          check(node)
        end

        def on_while(node)
          check(node)
        end

        def on_until(node)
          check(node)
        end

        private

        def check(node)
          return if !node.loc.keyword.is?('elsif') && node.loc.end.nil?

          condition, = *node
          return unless on_different_line?(node.loc.keyword.line,
                                           condition.source_range.line)

          add_offense(condition, :expression, message(node.loc.keyword.source))
        end

        def message(keyword)
          "Place the condition on the same line as `#{keyword}`."
        end

        def on_different_line?(keyword_line, cond_line)
          keyword_line != cond_line
        end
      end
    end
  end
end


text:
package ru.job4j;
/**
 * Calculate.
 *
 * @author Dinar Khalfin (dinarhalfin@yahoo.com)
 * @version $Id$
 * @since 25.06.2017
 */
public class Calculate{
	/**
     * Main.
     * @param args - args.
     */
	public static void main(String[] args){
		System.out.println("Hello, World!");
	}
}


text:
.class public Lcom/android/setupwizardlib/util/SystemBarHelper;
.super Ljava/lang/Object;
.source "SystemBarHelper.java"

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/android/setupwizardlib/util/SystemBarHelper$DecorViewFinder;,
        Lcom/android/setupwizardlib/util/SystemBarHelper$OnDecorViewInstalledListener;
    }
.end annotation

# direct methods
.method public constructor <init>()V
    .locals 0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method private static addImmersiveFlagsToDecorView(Landroid/view/Window;I)V
    .locals 1
    .annotation build Landroid/annotation/TargetApi;
        value = 0x15
    .end annotation

    new-instance v0, Lcom/android/setupwizardlib/util/SystemBarHelper$1;

    invoke-direct {v0, p1}, Lcom/android/setupwizardlib/util/SystemBarHelper$1;-><init>(I)V

    invoke-static {p0, v0}, Lcom/android/setupwizardlib/util/SystemBarHelper;->getDecorView(Landroid/view/Window;Lcom/android/setupwizardlib/util/SystemBarHelper$OnDecorViewInstalledListener;)V

    return-void
.end method

.method public static addVisibilityFlag(Landroid/view/View;I)V
    .locals 3

    sget v1, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v2, 0xb

    if-lt v1, v2, :cond_0

    invoke-virtual {p0}, Landroid/view/View;->getSystemUiVisibility()I

    move-result v0

    or-int v1, v0, p1

    invoke-virtual {p0, v1}, Landroid/view/View;->setSystemUiVisibility(I)V

    :cond_0
    return-void
.end method

.method public static addVisibilityFlag(Landroid/view/Window;I)V
    .locals 3

    sget v1, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v2, 0xb

    if-lt v1, v2, :cond_0

    invoke-virtual {p0}, Landroid/view/Window;->getAttributes()Landroid/view/WindowManager$LayoutParams;

    move-result-object v0

    iget v1, v0, Landroid/view/WindowManager$LayoutParams;->systemUiVisibility:I

    or-int/2addr v1, p1

    iput v1, v0, Landroid/view/WindowManager$LayoutParams;->systemUiVisibility:I

    invoke-virtual {p0, v0}, Landroid/view/Window;->setAttributes(Landroid/view/WindowManager$LayoutParams;)V

    :cond_0
    return-void
.end method

.method private static getDecorView(Landroid/view/Window;Lcom/android/setupwizardlib/util/SystemBarHelper$OnDecorViewInstalledListener;)V
    .locals 2

    new-instance v0, Lcom/android/setupwizardlib/util/SystemBarHelper$DecorViewFinder;

    const/4 v1, 0x0

    invoke-direct {v0, v1}, Lcom/android/setupwizardlib/util/SystemBarHelper$DecorViewFinder;-><init>(Lcom/android/setupwizardlib/util/SystemBarHelper$DecorViewFinder;)V

    const/4 v1, 0x3

    invoke-virtual {v0, p0, p1, v1}, Lcom/android/setupwizardlib/util/SystemBarHelper$DecorViewFinder;->getDecorView(Landroid/view/Window;Lcom/android/setupwizardlib/util/SystemBarHelper$OnDecorViewInstalledListener;I)V

    return-void
.end method

.method public static hideSystemBars(Landroid/app/Dialog;)V
    .locals 5

    const/16 v4, 0x1002

    const/4 v3, 0x0

    sget v1, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v2, 0x15

    if-lt v1, v2, :cond_0

    invoke-virtual {p0}, Landroid/app/Dialog;->getWindow()Landroid/view/Window;

    move-result-object v0

    invoke-static {v0}, Lcom/android/setupwizardlib/util/SystemBarHelper;->temporarilyDisableDialogFocus(Landroid/view/Window;)V

    invoke-static {v0, v4}, Lcom/android/setupwizardlib/util/SystemBarHelper;->addVisibilityFlag(Landroid/view/Window;I)V

    invoke-static {v0, v4}, Lcom/android/setupwizardlib/util/SystemBarHelper;->addImmersiveFlagsToDecorView(Landroid/view/Window;I)V

    invoke-virtual {v0, v3}, Landroid/view/Window;->setNavigationBarColor(I)V

    invoke-virtual {v0, v3}, Landroid/view/Window;->setStatusBarColor(I)V

    :cond_0
    return-void
.end method

.method public static hideSystemBars(Landroid/view/Window;)V
    .locals 4

    const/16 v3, 0x1602

    const/4 v2, 0x0

    sget v0, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v1, 0x15

    if-lt v0, v1, :cond_0

    invoke-static {p0, v3}, Lcom/android/setupwizardlib/util/SystemBarHelper;->addVisibilityFlag(Landroid/view/Window;I)V

    invoke-static {p0, v3}, Lcom/android/setupwizardlib/util/SystemBarHelper;->addImmersiveFlagsToDecorView(Landroid/view/Window;I)V

    invoke-virtual {p0, v2}, Landroid/view/Window;->setNavigationBarColor(I)V

    invoke-virtual {p0, v2}, Landroid/view/Window;->setStatusBarColor(I)V

    :cond_0
    return-void
.end method

.method private static temporarilyDisableDialogFocus(Landroid/view/Window;)V
    .locals 2

    const/16 v0, 0x8

    invoke-virtual {p0, v0, v0}, Landroid/view/Window;->setFlags(II)V

    const/16 v0, 0x100

    invoke-virtual {p0, v0}, Landroid/view/Window;->setSoftInputMode(I)V

    new-instance v0, Landroid/os/Handler;

    invoke-direct {v0}, Landroid/os/Handler;-><init>()V

    new-instance v1, Lcom/android/setupwizardlib/util/SystemBarHelper$3;

    invoke-direct {v1, p0}, Lcom/android/setupwizardlib/util/SystemBarHelper$3;-><init>(Landroid/view/Window;)V

    invoke-virtual {v0, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    return-void
.end method


text:
title:  Kainov trest
date:  13/04/2022
---

>

> 9Tu sa Hospodin spýtal Kaina: "Kde je tvoj brat Ábel?" On odvetil: "Neviem. Som azda strážcom svojho brata?" 10Opäť sa ho spýtal: "Čo si to urobil? Hlas krvi tvojho brata kričí ku mne zo zeme. 11Teraz budeš kliatbou vyhnaný z pôdy, ktorá otvorila ústa, aby z tvojej ruky vypila krv tvojho brata. 12Keď budeš obrábať pôdu, už ti nevydá svoju silu. Budeš sa nepokojne potulovať po zemi." 13Kain povedal Hospodinovi: "Môj trest je väčší, než vládzem zniesť. 14Ty ma dnes vyháňaš z pôdy a budem sa skrývať pred tebou. Budem sa nepokojne potulovať po zemi; ktokoľvek ma stretne, zabije ma." 15Hospodin mu však povedal: "Nie, to sa nestane, lebo ktokoľvek by zabil Kaina, toho postihne sedemnásobná pomsta." Hospodin poznačil Kaina, aby ho nikto, kto ho stretne, nezabil. 16Kain sa vzdialil od Hospodina a býval v kraji Nód, na východ od Edenu.

**Osobné štúdium**

`Uvažuj o úvodnom texte (Gn 4,9–16). Prečo Boh kladie Kainovi otázku: "Kde je tvoj brat Ábel?" Ako súvisí Kainov hriech s tým, že sa mal "nepokojne potulovať po zemi" (Gn 4,12)?`

Božia otázka adresovaná Kainovi nám môže znieť povedome, pretože v nej počujeme ozvenu otázky smerovanú Adamovi v raji. Ukazuje sa nám tak prepojenie medzi Kainovým hriechom, ktorý je následkom Adamovho hriechu.

Kain si však svoj hriech nepriznáva, popiera ho. Je to opak Adamovho postoja. Ten sa síce pokúša hodiť vinu na niekoho iného (na Evu a na Boha), ale skutkovú podstatu nepopiera. Naopak, Kain otvorene Bohu vzdoruje. Hospodin však nestráca čas a nekonfrontuje Kaina s jeho zločinom. Dokonca ani nečaká Kainovu odpoveď, keď mu položí otázku: "Čo si to urobil?" Pripomína Kainovi, že vie všetko, pretože hlas Ábelovej krvi k nemu kričí zo zeme (Gn 4,10). Tento obraz znamená, že Boh o vražde vie a bude na ňu reagovať. Ábel je v zemi, čo nás vracia späť k pádu v rajskej záhrade a k slovám adresovaným Adamovi (pozri Gn 3,19).

`Zameraj sa na text Gn 4,14. Aký význam majú Kainove slová "budem sa skrývať pred tebou"?`

Pretože Ábelova krv vytiekla na pôdu, tá bola teraz opäť prekliata (Gn 4,12). Výsledkom je, že Kain je odsúdený stať sa utečencom, bude "sa nepokojne potulovať po zemi". Až keď Kain počul Božie slová, uznáva dôležitosť Božej prítomnosti. Bez Boha sa bojí o vlastný život. Aj keď Kain chladnokrvne zavraždil svojho brata a odmietal tejto skutočnosti čeliť, Hospodin mu prejavoval milosrdenstvo. Napriek tomu, že sa "Kain vzdialil od Hospodina" (Gn 4,16), ten mu neustále poskytoval určitý druh ochrany. Nevieme presne, aké "znamenie" (Gn 4,15) Kain dostal. Nech už išlo o čokoľvek, bolo výsledkom Božej milosti prejavenej Kainovi.

**Aplikácia**

`Text hovorí: "Budem sa skrývať pred tvojou tvárou." (Gn 4,14) Je možné niečo skryť pred Bohom? Odísť od Boha tak, že s ním stratíme úplný kontakt, je tragické. Aký je jediný spôsob, ktorým sa ako hriešnici môžeme vyhnúť takejto situácii?`

---

#### Dodatečné otázky k diskuzi

`Jakou otázku klade Stvořitel Kainovi poté, co zabil svého bratra? Proč to dělá, když věděl, co se stalo?`

`Jak by Bůh reagoval, kdyby Kain činil pokání a litoval svého hříchu?`

`Proč se Kain zpočátku tváří, jako by se nic nestalo? Co nám to vypovídá o zrůdnosti hříchu a jeho působení na naše nitro?`

`Jaký vliv mělo mít Kainovo jednání na "půdu", která ho živila? Proč?`

`Z čeho měl Kain strach a jak na jeho strach reaguje Bůh?`

`Jak se v tomto znamení projevuje Boží milost, nabídnutá Kainovi?`

`Proč Kain tak otevřeně vzdoruje Bohu, i když jasně ví, že je to Stvořitel?`

`Proč někteří lidé odmítají Boha i když s nimi hovoří osobně?`


text:
def make_address(street, city, state, zip)
  return 'You live at ' + street + ', in the beautiful city of ' + city + ', ' + state + '. Your zip is ' + zip + '.'
end
# I worked on this challenge [by myself, with: ].
#by myself

# Your Solution Below
make_address("633 Folsom St.","San Francisco","CA","94107")


text:
package iunknown

import (
	"unsafe"

	"github.com/jacobsantos/go-com/com"
	syscall "golang.org/x/sys/windows"
)

// QueryInterfaceService implements QueryInterface for IUnknown interface.
//
// This is for COM server or IUnknown callback.
func QueryInterfaceService(self *interface{}, interfaceID *com.GUID, client **interface{}) uint32 {
	obj := (*com.ServiceReference)(unsafe.Pointer(self))
	*client = nil
	if interfaceID.IsEqual(InterfaceID) || interfaceID.IsEqual(obj.InterfaceID) {
		AddRefCallback(self)
		*client = self
		return com.SuccessResponseCode
	}
	return com.NoInterfaceErrorCode
}

// AddRefService implements AddRef for IUnknown interface.
//
// This is for COM server or IUnknown callback.
func AddRefService(self *interface{}) int32 {
	obj := (*UnknownServer)(unsafe.Pointer(self))
	obj.ReferenceCount++
	return obj.ReferenceCount
}

// ReleaseService implements Release for IUnknown interface.
//
// This is for COM server or IUnknown callback.
func ReleaseService(self *interface{}) int32 {
	obj := (*UnknownServer)(unsafe.Pointer(self))
	obj.ReferenceCount--
	return obj.ReferenceCount
}

// VirtualTableService creates VirtualTable with references to IUnknown methods.
//
// This should be used with Service().
func VirtualTableService() *VirtualTable {
	return &VirtualTable{
		QueryInterface: syscall.NewCallback(QueryInterfaceService),
		AddRef:         syscall.NewCallback(AddRefService),
		Release:        syscall.NewCallback(ReleaseService)}
}

// IUnknownService creates IUnknown interface COM server reference object.
func IUnknownService(obj *interface{}) (*com.ServerObject, error) {
	return Service(obj, VirtualTableService(), InterfaceID)
}


text:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">

  <title>Qt 4.3: tableeditor.cpp Example File (sql/cachedtable/tableeditor.cpp)</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />

  	Home · All Classes · Main Classes · Grouped Classes · Modules · Functions

tableeditor.cpp Example File
sql/cachedtable/tableeditor.cpp

 #include <QtGui>
 #include <QtSql>

 #include "tableeditor.h"

 TableEditor::TableEditor(const QString &tableName, QWidget *parent)
     : QDialog(parent)
 {
     model = new QSqlTableModel(this);
     model->setTable(tableName);
     model->setEditStrategy(QSqlTableModel::OnManualSubmit);
     model->select();

     model->setHeaderData(0, Qt::Horizontal, tr("ID"));
     model->setHeaderData(1, Qt::Horizontal, tr("First name"));
     model->setHeaderData(2, Qt::Horizontal, tr("Last name"));

     QTableView *view = new QTableView;
     view->setModel(model);

     submitButton = new QPushButton(tr("Submit"));
     submitButton->setDefault(true);
     revertButton = new QPushButton(tr("&Revert"));
     quitButton = new QPushButton(tr("Quit"));

     buttonBox = new QDialogButtonBox(Qt::Vertical);
     buttonBox->addButton(submitButton, QDialogButtonBox::ActionRole);
     buttonBox->addButton(revertButton, QDialogButtonBox::ActionRole);
     buttonBox->addButton(quitButton, QDialogButtonBox::RejectRole);

     connect(submitButton, SIGNAL(clicked()), this, SLOT(submit()));
     connect(revertButton, SIGNAL(clicked()), model, SLOT(revertAll()));
     connect(quitButton, SIGNAL(clicked()), this, SLOT(close()));

     QHBoxLayout *mainLayout = new QHBoxLayout;
     mainLayout->addWidget(view);
     mainLayout->addWidget(buttonBox);
     setLayout(mainLayout);

     setWindowTitle(tr("Cached Table"));
 }

 void TableEditor::submit()
 {
     model->database().transaction();
     if (model->submitAll()) {
         model->database().commit();
     } else {
         model->database().rollback();
         QMessageBox::warning(this, tr("Cached Table"),
                              tr("The database reported an error: %1")
                              .arg(model->lastError().text()));
     }
 }

<address>

Copyright © 2008 Trolltech
Trademarks

Qt 4.3.5

</address>


text:
<?xml version="1.0" encoding="utf-8"?>
<geo:GeodesyML gml:id="YELO00AUS" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:geo="urn:xml-gov-au:icsm:egeodesy:0.4" xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <geo:siteLog gml:id="yelo_20161216.log">
        <geo:formInformation>
            <geo:preparedBy>Ted Zhou</geo:preparedBy>
            <geo:datePrepared>2016-12-16</geo:datePrepared>
            <geo:reportType>UPDATE</geo:reportType>
        </geo:formInformation>
        <geo:siteIdentification>
            <geo:siteName>Yellowdine</geo:siteName>
            <geo:fourCharacterID>YELO</geo:fourCharacterID>
            <geo:monumentInscription></geo:monumentInscription>
            <geo:iersDOMESNumber>50199M001</geo:iersDOMESNumber>
            <geo:cdpNumber>NONE</geo:cdpNumber>
            <geo:monumentDescription codeSpace="urn:ga-gov-au:monument-description-type">PILLAR</geo:monumentDescription>
            <geo:heightOfTheMonument>1.8</geo:heightOfTheMonument>
            <geo:monumentFoundation>STEEL RODS / CONCRETE BLOCK</geo:monumentFoundation>
            <geo:foundationDepth>0.2</geo:foundationDepth>
            <geo:markerDescription>STAINLESS STEEL PLATE, THREADED SPIGOT</geo:markerDescription>
            <geo:dateInstalled>2009-03-18</geo:dateInstalled>
            <geo:geologicCharacteristic codeSpace="urn:ga-gov-au:geologic-characteristic-type">BEDROCK</geo:geologicCharacteristic>
            <geo:bedrockType>GRANITE</geo:bedrockType>
            <geo:bedrockCondition>SOLID</geo:bedrockCondition>
            <geo:fractureSpacing></geo:fractureSpacing>
            <geo:faultZonesNearby codeSpace="urn:ga-gov-au:fault-zones-type">NO</geo:faultZonesNearby>
            <geo:notes></geo:notes>
        </geo:siteIdentification>
        <geo:siteLocation>
            <geo:city>Yellowdine</geo:city>
            <geo:state>Western Australia</geo:state>
            <geo:countryCodeISO codeList="http://xml.gov.au/icsm/geodesyml/codelists/antenna-receiver-codelists.xml#GeodesyML_CountryTypeCode" codeListValue="Australia" codeSpace="urn:xml-gov-au:icsm:egeodesy:0.4">Australia</geo:countryCodeISO>
            <geo:tectonicPlate codeSpace="urn:ga-gov-au:plate-type">AUSTRALIAN</geo:tectonicPlate>
            <geo:approximatePositionITRF>
                <geo:cartesianPosition>
                    <gml:Point gml:id="itrf_cartesian" srsName="EPSG:7789">
                        <gml:pos>-2698549.5092 4741476.9104 -3293657.5426</gml:pos>
                    </gml:Point>
                </geo:cartesianPosition>
                <geo:geodeticPosition>
                    <gml:Point gml:id="itrf_geodetic" srsName="EPSG:7912">
                        <gml:pos>-31.2906898611 119.645801611 347.1477</gml:pos>
                    </gml:Point>
                </geo:geodeticPosition>
            </geo:approximatePositionITRF>
            <geo:notes></geo:notes>
        </geo:siteLocation>
        <geo:gnssReceiver>
            <geo:GnssReceiver gml:id="gnss-receiver-1">
                <geo:manufacturerSerialNumber>355562</geo:manufacturerSerialNumber>
                <geo:igsModelCode codeList="http://xml.gov.au/icsm/geodesyml/codelists/antenna-receiver-codelists.xml#GeodesyML_GNSSReceiverTypeCode" codeListValue="LEICA GRX1200GGPRO" codeSpace="urn:xml-gov-au:icsm:egeodesy:0.4">LEICA GRX1200GGPRO</geo:igsModelCode>
                <geo:satelliteSystem>GPS+GLO</geo:satelliteSystem>
                <geo:firmwareVersion>5.62</geo:firmwareVersion>
                <geo:elevationCutoffSetting>0.0</geo:elevationCutoffSetting>
                <geo:dateInstalled>2009-05-29T05:00:00Z</geo:dateInstalled>
                <geo:dateRemoved>2009-09-07T04:59:00Z</geo:dateRemoved>
                <geo:temperatureStabilization xsi:nil="true"></geo:temperatureStabilization>
            </geo:GnssReceiver>
            <geo:dateInserted>2009-05-29T05:00:00Z</geo:dateInserted>
        </geo:gnssReceiver>
        <geo:gnssReceiver>
            <geo:GnssReceiver gml:id="gnss-receiver-2">
                <geo:notes>Tracking changed to all in view, and
L2P(Y) straight after firmware upgrade.
Tracking changed to all SVs regardless of
health status at 2009-09-24T03:30Z.</geo:notes>
                <geo:manufacturerSerialNumber>355562</geo:manufacturerSerialNumber>
                <geo:igsModelCode codeList="http://xml.gov.au/icsm/geodesyml/codelists/antenna-receiver-codelists.xml#GeodesyML_GNSSReceiverTypeCode" codeListValue="LEICA GRX1200GGPRO" codeSpace="urn:xml-gov-au:icsm:egeodesy:0.4">LEICA GRX1200GGPRO</geo:igsModelCode>
                <geo:satelliteSystem>GPS+GLO</geo:satelliteSystem>
                <geo:firmwareVersion>7.50/3.017</geo:firmwareVersion>
                <geo:elevationCutoffSetting>0.0</geo:elevationCutoffSetting>
                <geo:dateInstalled>2009-09-07T05:00:00Z</geo:dateInstalled>
                <geo:dateRemoved>2010-10-08T04:30:00Z</geo:dateRemoved>
                <geo:temperatureStabilization xsi:nil="true"></geo:temperatureStabilization>
            </geo:GnssReceiver>
            <geo:dateInserted>2009-09-07T05:00:00Z</geo:dateInserted>
        </geo:gnssReceiver>
        <geo:gnssReceiver>
            <geo:GnssReceiver gml:id="gnss-receiver-3">
                <geo:notes>FW upgrade to fix tracking issues</geo:notes>
                <geo:manufacturerSerialNumber>355562</geo:manufacturerSerialNumber>
                <geo:igsModelCode codeList="http://xml.gov.au/icsm/geodesyml/codelists/antenna-receiver-codelists.xml#GeodesyML_GNSSReceiverTypeCode" codeListValue="LEICA GRX1200GGPRO" codeSpace="urn:xml-gov-au:icsm:egeodesy:0.4">LEICA GRX1200GGPRO</geo:igsModelCode>
                <geo:satelliteSystem>GPS+GLO</geo:satelliteSystem>
                <geo:firmwareVersion>8.01/3.019</geo:firmwareVersion>
                <geo:elevationCutoffSetting>0.0</geo:elevationCutoffSetting>
                <geo:dateInstalled>2010-10-08T04:30:00Z</geo:dateInstalled>
                <geo:dateRemoved>2011-08-30T00:00:00Z</geo:dateRemoved>
                <geo:temperatureStabilization xsi:nil="true"></geo:temperatureStabilization>
            </geo:GnssReceiver>
            <geo:dateInserted>2010-10-08T04:30:00Z</geo:dateInserted>
        </geo:gnssReceiver>
        <geo:gnssReceiver>
            <geo:GnssReceiver gml:id="gnss-receiver-4">
                <geo:notes>FW upgrade</geo:notes>
                <geo:manufacturerSerialNumber>355562</geo:manufacturerSerialNumber>
                <geo:igsModelCode codeList="http://xml.gov.au/icsm/geodesyml/codelists/antenna-receiver-codelists.xml#GeodesyML_GNSSReceiverTypeCode" codeListValue="LEICA GRX1200GGPRO" codeSpace="urn:xml-gov-au:icsm:egeodesy:0.4">LEICA GRX1200GGPRO</geo:igsModelCode>
                <geo:satelliteSystem>GPS+GLO</geo:satelliteSystem>
                <geo:firmwareVersion>8.20/3.019</geo:firmwareVersion>
                <geo:elevationCutoffSetting>0.0</geo:elevationCutoffSetting>
                <geo:dateInstalled>2011-08-30T00:00:00Z</geo:dateInstalled>
                <geo:dateRemoved>2013-03-28T00:00:00Z</geo:dateRemoved>
                <geo:temperatureStabilization xsi:nil="true"></geo:temperatureStabilization>
            </geo:GnssReceiver>
            <geo:dateInserted>2011-08-30T00:00:00Z</geo:dateInserted>
        </geo:gnssReceiver>
        <geo:gnssReceiver>
            <geo:GnssReceiver gml:id="gnss-receiver-5">
                <geo:notes>FW upgrade</geo:notes>
                <geo:manufacturerSerialNumber>355562</geo:manufacturerSerialNumber>
                <geo:igsModelCode codeList="http://xml.gov.au/icsm/geodesyml/codelists/antenna-receiver-codelists.xml#GeodesyML_GNSSReceiverTypeCode" codeListValue="LEICA GRX1200GGPRO" codeSpace="urn:xml-gov-au:icsm:egeodesy:0.4">LEICA GRX1200GGPRO</geo:igsModelCode>
                <geo:satelliteSystem>GPS+GLO</geo:satelliteSystem>
                <geo:firmwareVersion>8.51/3.019</geo:firmwareVersion>
                <geo:elevationCutoffSetting>0.0</geo:elevationCutoffSetting>
                <geo:dateInstalled>2013-03-28T00:00:00Z</geo:dateInstalled>
                <geo:dateRemoved>2014-07-17T00:00:00Z</geo:dateRemoved>
                <geo:temperatureStabilization xsi:nil="true"></geo:temperatureStabilization>
            </geo:GnssReceiver>
            <geo:dateInserted>2013-03-28T00:00:00Z</geo:dateInserted>
        </geo:gnssReceiver>
        <geo:gnssReceiver>
            <geo:GnssReceiver gml:id="gnss-receiver-6">
                <geo:notes>FW upgrade</geo:notes>
                <geo:manufacturerSerialNumber>355562</geo:manufacturerSerialNumber>
                <geo:igsModelCode codeList="http://xml.gov.au/icsm/geodesyml/codelists/antenna-receiver-codelists.xml#GeodesyML_GNSSReceiverTypeCode" codeListValue="LEICA GRX1200GGPRO" codeSpace="urn:xml-gov-au:icsm:egeodesy:0.4">LEICA GRX1200GGPRO</geo:igsModelCode>
                <geo:satelliteSystem>GPS+GLO</geo:satelliteSystem>
                <geo:firmwareVersion>8.71/3.823</geo:firmwareVersion>
                <geo:elevationCutoffSetting>0.0</geo:elevationCutoffSetting>
                <geo:dateInstalled>2014-07-17T00:00:00Z</geo:dateInstalled>
                <geo:dateRemoved>2016-03-14T00:00:00Z</geo:dateRemoved>
                <geo:temperatureStabilization xsi:nil="true"></geo:temperatureStabilization>
            </geo:GnssReceiver>
            <geo:dateInserted>2014-07-17T00:00:00Z</geo:dateInserted>
        </geo:gnssReceiver>
        <geo:gnssReceiver>
            <geo:GnssReceiver gml:id="gnss-receiver-7">
                <geo:manufacturerSerialNumber>5306K50882</geo:manufacturerSerialNumber>
                <geo:igsModelCode codeList="http://xml.gov.au/icsm/geodesyml/codelists/antenna-receiver-codelists.xml#GeodesyML_GNSSReceiverTypeCode" codeListValue="TRIMBLE NETR9" codeSpace="urn:xml-gov-au:icsm:egeodesy:0.4">TRIMBLE NETR9</geo:igsModelCode>
                <geo:satelliteSystem>GPS+GLO+GAL+BDS+QZSS</geo:satelliteSystem>
                <geo:firmwareVersion>5.10</geo:firmwareVersion>
                <geo:elevationCutoffSetting>0.0</geo:elevationCutoffSetting>
                <geo:dateInstalled>2016-03-14T00:00:00Z</geo:dateInstalled>
                <geo:dateRemoved>2016-12-16T00:00:00Z</geo:dateRemoved>
                <geo:temperatureStabilization xsi:nil="true"></geo:temperatureStabilization>
            </geo:GnssReceiver>
            <geo:dateInserted>2016-03-14T00:00:00Z</geo:dateInserted>
        </geo:gnssReceiver>
        <geo:gnssReceiver>
            <geo:GnssReceiver gml:id="gnss-receiver-8">
                <geo:notes>Firmware upgrade only</geo:notes>
                <geo:manufacturerSerialNumber>5306K50882</geo:manufacturerSerialNumber>
                <geo:igsModelCode codeList="http://xml.gov.au/icsm/geodesyml/codelists/antenna-receiver-codelists.xml#GeodesyML_GNSSReceiverTypeCode" codeListValue="TRIMBLE NETR9" codeSpace="urn:xml-gov-au:icsm:egeodesy:0.4">TRIMBLE NETR9</geo:igsModelCode>
                <geo:satelliteSystem>GPS+GLO+GAL+BDS+QZSS</geo:satelliteSystem>
                <geo:firmwareVersion>5.15</geo:firmwareVersion>
                <geo:elevationCutoffSetting>0.0</geo:elevationCutoffSetting>
                <geo:dateInstalled>2016-12-16T00:00:00Z</geo:dateInstalled>
                <geo:dateRemoved></geo:dateRemoved>
                <geo:temperatureStabilization xsi:nil="true"></geo:temperatureStabilization>
            </geo:GnssReceiver>
            <geo:dateInserted>2016-12-16T00:00:00Z</geo:dateInserted>
        </geo:gnssReceiver>
        <geo:gnssAntenna>
            <geo:GnssAntenna gml:id="gnss-antenna-1">
                <geo:manufacturerSerialNumber>200523</geo:manufacturerSerialNumber>
                <geo:igsModelCode codeList="http://xml.gov.au/icsm/geodesyml/codelists/antenna-receiver-codelists.xml#GeodesyML_GNSSAntennaTypeCode" codeListValue="LEIAT504GG SCIS" codeSpace="urn:xml-gov-au:icsm:egeodesy:0.4">LEIAT504GG      SCIS</geo:igsModelCode>
                <geo:antennaReferencePoint codeSpace="urn:ga-gov-au:antenna-reference-point-type">BPA</geo:antennaReferencePoint>
                <geo:marker-arpUpEcc.>0.0</geo:marker-arpUpEcc.>
                <geo:marker-arpNorthEcc.>0.0</geo:marker-arpNorthEcc.>
                <geo:marker-arpEastEcc.>0.0</geo:marker-arpEastEcc.>
                <geo:alignmentFromTrueNorth>0.0</geo:alignmentFromTrueNorth>
                <geo:antennaRadomeType codeSpace="urn:igs-org:gnss-radome-model-code">SCIS</geo:antennaRadomeType>
                <geo:radomeSerialNumber>N/A</geo:radomeSerialNumber>
                <geo:antennaCableType>RG214</geo:antennaCableType>
                <geo:antennaCableLength>28.0</geo:antennaCableLength>
                <geo:dateInstalled>2009-05-29T05:00:00Z</geo:dateInstalled>
                <geo:dateRemoved>2013-12-12T08:38:00Z</geo:dateRemoved>
            </geo:GnssAntenna>
            <geo:dateInserted>2009-05-29T05:00:00Z</geo:dateInserted>
        </geo:gnssAntenna>
        <geo:gnssAntenna>
            <geo:GnssAntenna gml:id="gnss-antenna-2">
                <geo:manufacturerSerialNumber>200523</geo:manufacturerSerialNumber>
                <geo:igsModelCode codeList="http://xml.gov.au/icsm/geodesyml/codelists/antenna-receiver-codelists.xml#GeodesyML_GNSSAntennaTypeCode" codeListValue="LEIAT504GG NONE" codeSpace="urn:xml-gov-au:icsm:egeodesy:0.4">LEIAT504GG      NONE</geo:igsModelCode>
                <geo:antennaReferencePoint codeSpace="urn:ga-gov-au:antenna-reference-point-type">BPA</geo:antennaReferencePoint>
                <geo:marker-arpUpEcc.>0.0</geo:marker-arpUpEcc.>
                <geo:marker-arpNorthEcc.>0.0</geo:marker-arpNorthEcc.>
                <geo:marker-arpEastEcc.>0.0</geo:marker-arpEastEcc.>
                <geo:alignmentFromTrueNorth>0.0</geo:alignmentFromTrueNorth>
                <geo:antennaRadomeType codeSpace="urn:igs-org:gnss-radome-model-code">NONE</geo:antennaRadomeType>
                <geo:radomeSerialNumber>N/A</geo:radomeSerialNumber>
                <geo:antennaCableType>RG214</geo:antennaCableType>
                <geo:antennaCableLength>28.0</geo:antennaCableLength>
                <geo:dateInstalled>2013-12-12T08:38:00Z</geo:dateInstalled>
                <geo:dateRemoved>2013-12-12T10:43:00Z</geo:dateRemoved>
            </geo:GnssAntenna>
            <geo:dateInserted>2013-12-12T08:38:00Z</geo:dateInserted>
        </geo:gnssAntenna>
        <geo:gnssAntenna>
            <geo:GnssAntenna gml:id="gnss-antenna-3">
                <geo:manufacturerSerialNumber>200523</geo:manufacturerSerialNumber>
                <geo:igsModelCode codeList="http://xml.gov.au/icsm/geodesyml/codelists/antenna-receiver-codelists.xml#GeodesyML_GNSSAntennaTypeCode" codeListValue="LEIAT504GG SCIS" codeSpace="urn:xml-gov-au:icsm:egeodesy:0.4">LEIAT504GG      SCIS</geo:igsModelCode>
                <geo:antennaReferencePoint codeSpace="urn:ga-gov-au:antenna-reference-point-type">BPA</geo:antennaReferencePoint>
                <geo:marker-arpUpEcc.>0.0</geo:marker-arpUpEcc.>
                <geo:marker-arpNorthEcc.>0.0</geo:marker-arpNorthEcc.>
                <geo:marker-arpEastEcc.>0.0</geo:marker-arpEastEcc.>
                <geo:alignmentFromTrueNorth>0.0</geo:alignmentFromTrueNorth>
                <geo:antennaRadomeType codeSpace="urn:igs-org:gnss-radome-model-code">SCIS</geo:antennaRadomeType>
                <geo:radomeSerialNumber>N/A</geo:radomeSerialNumber>
                <geo:antennaCableType>RG214</geo:antennaCableType>
                <geo:antennaCableLength>28.0</geo:antennaCableLength>
                <geo:dateInstalled>2013-12-12T10:43:00Z</geo:dateInstalled>
                <geo:dateRemoved>2016-03-14T00:00:00Z</geo:dateRemoved>
            </geo:GnssAntenna>
            <geo:dateInserted>2013-12-12T10:43:00Z</geo:dateInserted>
        </geo:gnssAntenna>
        <geo:gnssAntenna>
            <geo:GnssAntenna gml:id="gnss-antenna-4">
                <geo:manufacturerSerialNumber>920</geo:manufacturerSerialNumber>
                <geo:igsModelCode codeList="http://xml.gov.au/icsm/geodesyml/codelists/antenna-receiver-codelists.xml#GeodesyML_GNSSAntennaTypeCode" codeListValue="JAVRINGANT_DM SCIS" codeSpace="urn:xml-gov-au:icsm:egeodesy:0.4">JAVRINGANT_DM   SCIS</geo:igsModelCode>
                <geo:antennaReferencePoint codeSpace="urn:ga-gov-au:antenna-reference-point-type">BPA</geo:antennaReferencePoint>
                <geo:marker-arpUpEcc.>0.004</geo:marker-arpUpEcc.>
                <geo:marker-arpNorthEcc.>0.0</geo:marker-arpNorthEcc.>
                <geo:marker-arpEastEcc.>0.0</geo:marker-arpEastEcc.>
                <geo:alignmentFromTrueNorth>0.0</geo:alignmentFromTrueNorth>
                <geo:antennaRadomeType codeSpace="urn:igs-org:gnss-radome-model-code">SCIS</geo:antennaRadomeType>
                <geo:radomeSerialNumber>819</geo:radomeSerialNumber>
                <geo:antennaCableType>RG214</geo:antennaCableType>
                <geo:antennaCableLength>28.0</geo:antennaCableLength>
                <geo:dateInstalled>2016-03-14T00:00:00Z</geo:dateInstalled>
                <geo:dateRemoved></geo:dateRemoved>
            </geo:GnssAntenna>
            <geo:dateInserted>2016-03-14T00:00:00Z</geo:dateInserted>
        </geo:gnssAntenna>
        <geo:frequencyStandard>
            <geo:FrequencyStandard gml:id="frequency-standard-1">
                <geo:standardType codeSpace="urn:ga-gov-au:frequency-standard-type">INTERNAL</geo:standardType>
                <geo:inputFrequency>0.0</geo:inputFrequency>
                <gml:validTime>
                    <gml:TimePeriod gml:id="frequency-standard-1--time-period-1">
                        <gml:beginPosition>2009-05-29</gml:beginPosition>
                        <gml:endPosition></gml:endPosition>
                    </gml:TimePeriod>
                </gml:validTime>
                <geo:notes></geo:notes>
            </geo:FrequencyStandard>
            <geo:dateInserted>2009-05-29</geo:dateInserted>
        </geo:frequencyStandard>
        <geo:humiditySensor>
            <geo:HumiditySensor gml:id="humidity-sensor-1">
                <geo:type codeSpace="urn:ga-gov-au:humidity-sensor-type">PAROSCIENTIFIC MET4</geo:type>
                <geo:notes>(multiple lines)</geo:notes>
                <geo:manufacturer>Paroscientific</geo:manufacturer>
                <geo:serialNumber>DQ120999</geo:serialNumber>
                <geo:heightDiffToAntenna>-0.318</geo:heightDiffToAntenna>
                <geo:calibrationDate>2011-09-27</geo:calibrationDate>
                <gml:validTime>
                    <gml:TimePeriod gml:id="humidity-sensor-1--time-period-1">
                        <gml:beginPosition>2011-09-27</gml:beginPosition>
                        <gml:endPosition></gml:endPosition>
                    </gml:TimePeriod>
                </gml:validTime>
                <geo:dataSamplingInterval>30.0</geo:dataSamplingInterval>
                <geo:accuracy-percentRelativeHumidity>2.0</geo:accuracy-percentRelativeHumidity>
                <geo:aspiration>UNASPIRATED</geo:aspiration>
            </geo:HumiditySensor>
            <geo:dateInserted>2011-09-27</geo:dateInserted>
        </geo:humiditySensor>
        <geo:pressureSensor>
            <geo:PressureSensor gml:id="pressure-sensor-1">
                <geo:type codeSpace="urn:ga-gov-au:pressure-sensor-type">PAROSCIENTIFIC MET4</geo:type>
                <geo:manufacturer>Paroscientific</geo:manufacturer>
                <geo:serialNumber>DQ120999</geo:serialNumber>
                <geo:heightDiffToAntenna>-0.318</geo:heightDiffToAntenna>
                <geo:calibrationDate>2011-09-27</geo:calibrationDate>
                <gml:validTime>
                    <gml:TimePeriod gml:id="pressure-sensor-1--time-period-2">
                        <gml:beginPosition>2011-09-27</gml:beginPosition>
                        <gml:endPosition></gml:endPosition>
                    </gml:TimePeriod>
                </gml:validTime>
                <geo:dataSamplingInterval>30.0</geo:dataSamplingInterval>
                <geo:accuracy-hPa>0.08</geo:accuracy-hPa>
            </geo:PressureSensor>
            <geo:dateInserted>2011-09-27</geo:dateInserted>
        </geo:pressureSensor>
        <geo:temperatureSensor>
            <geo:TemperatureSensor gml:id="temperature-sensor-1">
                <geo:type codeSpace="urn:ga-gov-au:temperature-sensor-type">PAROSCIENTIFIC MET4</geo:type>
                <geo:manufacturer>Paroscientific</geo:manufacturer>
                <geo:serialNumber>DQ120999</geo:serialNumber>
                <geo:heightDiffToAntenna>-0.318</geo:heightDiffToAntenna>
                <geo:calibrationDate>2011-09-27</geo:calibrationDate>
                <gml:validTime>
                    <gml:TimePeriod gml:id="temperature-sensor-1--time-period-3">
                        <gml:beginPosition>2011-09-27</gml:beginPosition>
                        <gml:endPosition></gml:endPosition>
                    </gml:TimePeriod>
                </gml:validTime>
                <geo:dataSamplingInterval>30.0</geo:dataSamplingInterval>
                <geo:accuracy-degreesCelcius>0.5</geo:accuracy-degreesCelcius>
                <geo:aspiration>UNASPIRATED</geo:aspiration>
            </geo:TemperatureSensor>
            <geo:dateInserted>2011-09-27</geo:dateInserted>
        </geo:temperatureSensor>
        <geo:siteContact gml:id="agency-1">
            <gmd:MD_SecurityConstraints>
                <gmd:classification gco:nilReason="missing"/>
            </gmd:MD_SecurityConstraints>
            <gmd:CI_ResponsibleParty>
                <gmd:individualName>
                    <gco:CharacterString>Doug Hardman</gco:CharacterString>
                </gmd:individualName>
                <gmd:organisationName>
                    <gco:CharacterString>WA Landgate</gco:CharacterString>
                </gmd:organisationName>
                <gmd:contactInfo>
                    <gmd:CI_Contact>
                        <gmd:phone>
                            <gmd:CI_Telephone>
                                <gmd:voice>
                                    <gco:CharacterString>+61 8 9273 7117</gco:CharacterString>
                                </gmd:voice>
                                <gmd:facsimile>
                                    <gco:CharacterString></gco:CharacterString>
                                </gmd:facsimile>
                            </gmd:CI_Telephone>
                        </gmd:phone>
                        <gmd:address>
                            <gmd:CI_Address>
                                <gmd:deliveryPoint>
                                    <gco:CharacterString>1 Midland Square
Midland  WA  6056
AUSTRALIA</gco:CharacterString>
                                </gmd:deliveryPoint>
                                <gmd:city>
                                    <gco:CharacterString>Midland</gco:CharacterString>
                                </gmd:city>
                                <gmd:postalCode>
                                    <gco:CharacterString>6056</gco:CharacterString>
                                </gmd:postalCode>
                                <gmd:country>
                                    <gco:CharacterString>Australia</gco:CharacterString>
                                </gmd:country>
                                <gmd:electronicMailAddress>
                                    <gco:CharacterString>doug.hardman@landgate.wa.gov.au</gco:CharacterString>
                                </gmd:electronicMailAddress>
                            </gmd:CI_Address>
                        </gmd:address>
                    </gmd:CI_Contact>
                </gmd:contactInfo>
                <gmd:role>
                    <gmd:CI_RoleCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_RoleCode" codeListValue="pointOfContact"></gmd:CI_RoleCode>
                </gmd:role>
            </gmd:CI_ResponsibleParty>
        </geo:siteContact>
        <geo:siteMetadataCustodian gml:id="agency-2">
            <gmd:MD_SecurityConstraints>
                <gmd:classification gco:nilReason="missing"/>
            </gmd:MD_SecurityConstraints>
            <gmd:CI_ResponsibleParty>
                <gmd:individualName>
                    <gco:CharacterString>Nicholas Brown</gco:CharacterString>
                </gmd:individualName>
                <gmd:organisationName>
                    <gco:CharacterString>Geoscience Australia</gco:CharacterString>
                </gmd:organisationName>
                <gmd:contactInfo>
                    <gmd:CI_Contact>
                        <gmd:phone>
                            <gmd:CI_Telephone>
                                <gmd:voice>
                                    <gco:CharacterString>+61 2 6249 9831</gco:CharacterString>
                                </gmd:voice>
                                <gmd:facsimile>
                                    <gco:CharacterString></gco:CharacterString>
                                </gmd:facsimile>
                            </gmd:CI_Telephone>
                        </gmd:phone>
                        <gmd:address>
                            <gmd:CI_Address>
                                <gmd:deliveryPoint>
                                    <gco:CharacterString>GPO Box 378
Canberra  ACT  2601
AUSTRALIA</gco:CharacterString>
                                </gmd:deliveryPoint>
                                <gmd:city>
                                    <gco:CharacterString>Canberra</gco:CharacterString>
                                </gmd:city>
                                <gmd:postalCode>
                                    <gco:CharacterString>2601</gco:CharacterString>
                                </gmd:postalCode>
                                <gmd:country>
                                    <gco:CharacterString>Australia</gco:CharacterString>
                                </gmd:country>
                                <gmd:electronicMailAddress>
                                    <gco:CharacterString>geodesy@ga.gov.au</gco:CharacterString>
                                </gmd:electronicMailAddress>
                            </gmd:CI_Address>
                        </gmd:address>
                    </gmd:CI_Contact>
                </gmd:contactInfo>
                <gmd:role>
                    <gmd:CI_RoleCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_RoleCode" codeListValue="pointOfContact"></gmd:CI_RoleCode>
                </gmd:role>
            </gmd:CI_ResponsibleParty>
        </geo:siteMetadataCustodian>
        <geo:moreInformation>
            <geo:dataCenter>GA</geo:dataCenter>
            <geo:dataCenter>RDSI</geo:dataCenter>
            <geo:urlForMoreInformation></geo:urlForMoreInformation>
            <geo:siteMap>Y</geo:siteMap>
            <geo:siteDiagram>Y</geo:siteDiagram>
            <geo:horizonMask>Y</geo:horizonMask>
            <geo:monumentDescription>Y</geo:monumentDescription>
            <geo:sitePictures>Y</geo:sitePictures>
            <geo:notes></geo:notes>
            <geo:antennaGraphicsWithDimensions></geo:antennaGraphicsWithDimensions>
            <geo:insertTextGraphicFromAntenna></geo:insertTextGraphicFromAntenna>
            <geo:DOI codeSpace="urn:ga-gov-au:self.moreInformation-type">TODO</geo:DOI>
        </geo:moreInformation>
    </geo:siteLog>
</geo:GeodesyML>


text:
package org.guvnor.asset.management.backend.service;

import java.util.Collections;
import java.util.HashSet;
import javax.enterprise.event.Event;

import org.guvnor.asset.management.service.RepositoryStructureService;
import org.guvnor.common.services.backend.util.CommentedOptionFactory;
import org.guvnor.common.services.project.model.GAV;
import org.guvnor.common.services.project.model.MavenRepositoryMetadata;
import org.guvnor.common.services.project.model.MavenRepositorySource;
import org.guvnor.common.services.project.model.POM;
import org.guvnor.common.services.project.model.Project;
import org.guvnor.common.services.project.service.DeploymentMode;
import org.guvnor.common.services.project.service.GAVAlreadyExistsException;
import org.guvnor.common.services.project.service.POMService;
import org.guvnor.common.services.project.service.ProjectRepositoryResolver;
import org.guvnor.common.services.project.service.ProjectService;
import org.guvnor.common.services.shared.metadata.MetadataService;
import org.guvnor.m2repo.backend.server.GuvnorM2Repository;
import org.guvnor.structure.repositories.Repository;
import org.guvnor.structure.repositories.RepositoryService;
import org.guvnor.structure.repositories.RepositoryEnvironmentUpdatedEvent;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.uberfire.backend.vfs.Path;
import org.uberfire.io.IOService;
import org.uberfire.mocks.EventSourceMock;

import static org.junit.Assert.*;
import static org.mockito.Mockito.*;

@RunWith(MockitoJUnitRunner.class)
public class RepositoryStructureServiceImplTest {

    @Mock
    private IOService ioService;

    @Mock

    private POMService pomService;

    @Mock
    private ProjectService<Project> projectService;

    @Mock
    private RepositoryService repositoryService;

    @Mock
    private MetadataService metadataService;

    @Mock
    private GuvnorM2Repository m2service;

    @Mock
    private CommentedOptionFactory optionsFactory;

    private Event<RepositoryEnvironmentUpdatedEvent> repositoryUpdatedEvent = new EventSourceMock<RepositoryEnvironmentUpdatedEvent>() {
        @Override
        public void fire( RepositoryEnvironmentUpdatedEvent event ) {
            //Override as the default implementation throws an Exception
        }
    };

    @Mock
    private ProjectRepositoryResolver repositoryResolver;

    private RepositoryStructureService service;

    @BeforeClass
    public static void setupSystemProperties() {
        //These are not needed for the tests
        System.setProperty( "org.uberfire.nio.git.daemon.enabled",
                            "false" );
        System.setProperty( "org.uberfire.nio.git.ssh.enabled",
                            "false" );
        System.setProperty( "org.uberfire.sys.repo.monitor.disabled",
                            "true" );
    }

    @Before
    public void setup() {
        service = new RepositoryStructureServiceImpl( ioService,
                                                      pomService,
                                                      projectService,
                                                      repositoryService,
                                                      metadataService,
                                                      m2service,
                                                      optionsFactory,
                                                      repositoryUpdatedEvent,
                                                      repositoryResolver );
    }

    @Test
    public void testInitRepositoryStructure1() {
        final GAV gav = new GAV( "groupId",
                                 "artifactId",
                                 "version" );
        final Repository repository = mock( Repository.class );
        final Path repositoryRootPath = mock( Path.class );
        when( repository.getAlias() ).thenReturn( "alias" );
        when( repository.getRoot() ).thenReturn( repositoryRootPath );

        when( repositoryResolver.getRepositoriesResolvingArtifact( eq( gav ) ) ).thenReturn( Collections.<MavenRepositoryMetadata>emptySet() );

        service.initRepositoryStructure( gav,
                                         repository,
                                         DeploymentMode.VALIDATED );

        verify( repositoryResolver,
                times( 1 ) ).getRepositoriesResolvingArtifact( eq( gav ) );

        final ArgumentCaptor<POM> pomArgumentCaptor = ArgumentCaptor.forClass( POM.class );
        verify( pomService,
                times( 1 ) ).create( eq( repositoryRootPath ),
                                     eq( "" ),
                                     pomArgumentCaptor.capture() );

        assertNotNull( pomArgumentCaptor.getValue() );
        assertEquals( "groupId",
                      pomArgumentCaptor.getValue().getGav().getGroupId() );
        assertEquals( "artifactId",
                      pomArgumentCaptor.getValue().getGav().getArtifactId() );
        assertEquals( "version",
                      pomArgumentCaptor.getValue().getGav().getVersion() );

        verify( m2service,
                times( 1 ) ).deployParentPom( eq( gav ) );
    }

    @Test
    public void testInitRepositoryStructure1ClashingGAV() {
        final GAV gav = new GAV( "groupId",
                                 "artifactId",
                                 "version" );
        final Repository repository = mock( Repository.class );
        final Path repositoryRootPath = mock( Path.class );
        when( repository.getAlias() ).thenReturn( "alias" );
        when( repository.getRoot() ).thenReturn( repositoryRootPath );

        when( repositoryResolver.getRepositoriesResolvingArtifact( eq( gav ) ) ).thenReturn( new HashSet<MavenRepositoryMetadata>() {
            {
                add( new MavenRepositoryMetadata( "local-id",
                                                  "local-url",
                                                  MavenRepositorySource.LOCAL ) );
            }
        } );

        try {
            service.initRepositoryStructure( gav,
                                             repository,
                                             DeploymentMode.VALIDATED );

        } catch ( GAVAlreadyExistsException expected ) {
            //This is expected, but we want to verify the other services are not called
        }

        verify( repositoryResolver,
                times( 1 ) ).getRepositoriesResolvingArtifact( eq( gav ) );

        verify( pomService,
                never() ).create( eq( repositoryRootPath ),
                                  eq( "" ),
                                  any( POM.class ) );
        verify( m2service,
                never() ).deployParentPom( eq( gav ) );
    }

    @Test
    public void testInitRepositoryStructure1ClashingGAVForced() {
        final GAV gav = new GAV( "groupId",
                                 "artifactId",
                                 "version" );
        final Repository repository = mock( Repository.class );
        final Path repositoryRootPath = mock( Path.class );
        when( repository.getAlias() ).thenReturn( "alias" );
        when( repository.getRoot() ).thenReturn( repositoryRootPath );

        when( repositoryResolver.getRepositoriesResolvingArtifact( eq( gav ) ) ).thenReturn( new HashSet<MavenRepositoryMetadata>() {
            {
                add( new MavenRepositoryMetadata( "local-id",
                                                  "local-url",
                                                  MavenRepositorySource.LOCAL ) );
            }
        } );

        try {
            service.initRepositoryStructure( gav,
                                             repository,
                                             DeploymentMode.FORCED );

        } catch ( GAVAlreadyExistsException expected ) {
            //This is expected, but we want to verify the other services are not called
        }

        verify( repositoryResolver,
                never() ).getRepositoriesResolvingArtifact( eq( gav ) );

        final ArgumentCaptor<POM> pomArgumentCaptor = ArgumentCaptor.forClass( POM.class );
        verify( pomService,
                times( 1 ) ).create( eq( repositoryRootPath ),
                                     eq( "" ),
                                     pomArgumentCaptor.capture() );

        assertNotNull( pomArgumentCaptor.getValue() );
        assertEquals( "groupId",
                      pomArgumentCaptor.getValue().getGav().getGroupId() );
        assertEquals( "artifactId",
                      pomArgumentCaptor.getValue().getGav().getArtifactId() );
        assertEquals( "version",
                      pomArgumentCaptor.getValue().getGav().getVersion() );

        verify( m2service,
                times( 1 ) ).deployParentPom( eq( gav ) );
    }

    @Test
    public void testInitRepositoryStructure2SingleModule() {
        final GAV gav = new GAV( "groupId",
                                 "artifactId",
                                 "version" );
        final POM pom = new POM( gav );
        final Repository repository = mock( Repository.class );
        final Path repositoryRootPath = mock( Path.class );
        when( repository.getAlias() ).thenReturn( "alias" );
        when( repository.getRoot() ).thenReturn( repositoryRootPath );

        final Project project = mock( Project.class );
        final Path pomPath = mock( Path.class );
        when( project.getPomXMLPath() ).thenReturn( pomPath );

        when( repositoryResolver.getRepositoriesResolvingArtifact( eq( gav ) ) ).thenReturn( Collections.<MavenRepositoryMetadata>emptySet() );
        when( projectService.newProject( eq( repository ),
                                         eq( pom ),
                                         eq( "baseUrl" ),
                                         eq( DeploymentMode.VALIDATED ) ) ).thenReturn( project );

        service.initRepositoryStructure( pom,
                                         "baseUrl",
                                         repository,
                                         false,
                                         DeploymentMode.VALIDATED );

        verify( repositoryResolver,
                times( 1 ) ).getRepositoriesResolvingArtifact( eq( gav ) );

        verify( projectService,
                times( 1 ) ).newProject( eq( repository ),
                                         eq( pom ),
                                         eq( "baseUrl" ),
                                         eq( DeploymentMode.VALIDATED ) );
    }

    @Test
    public void testInitRepositoryStructure2SingleModuleClashingGAV() {
        final GAV gav = new GAV( "groupId",
                                 "artifactId",
                                 "version" );
        final POM pom = new POM( gav );
        final Repository repository = mock( Repository.class );
        final Path repositoryRootPath = mock( Path.class );
        when( repository.getAlias() ).thenReturn( "alias" );
        when( repository.getRoot() ).thenReturn( repositoryRootPath );

        final Project project = mock( Project.class );
        final Path pomPath = mock( Path.class );
        when( project.getPomXMLPath() ).thenReturn( pomPath );

        when( repositoryResolver.getRepositoriesResolvingArtifact( eq( gav ) ) ).thenReturn( new HashSet<MavenRepositoryMetadata>() {
            {
                add( new MavenRepositoryMetadata( "local-id",
                                                  "local-url",
                                                  MavenRepositorySource.LOCAL ) );
            }
        } );

        final GAVAlreadyExistsException gae = new GAVAlreadyExistsException( pom.getGav(),
                                                                             new HashSet<MavenRepositoryMetadata>() {{
                                                                                add( new MavenRepositoryMetadata( "local-id",
                                                                                "local-url",
                                                                                MavenRepositorySource.LOCAL ) );
                                                                             }} );
        doThrow( gae ).when( projectService ).newProject( eq( repository ),
                                                          eq( pom ),
                                                          eq( "baseUrl" ),
                                                          eq( DeploymentMode.VALIDATED ) );

        try {
            service.initRepositoryStructure( pom,
                                             "baseUrl",
                                             repository,
                                             false,
                                             DeploymentMode.VALIDATED );

        } catch ( GAVAlreadyExistsException expected ) {
            //This is expected, but we want to verify the other services are not called
        }

        verify( repositoryResolver,
                times( 1 ) ).getRepositoriesResolvingArtifact( eq( gav ) );

        verify( projectService,
                never() ).newProject( eq( repository ),
                                      eq( pom ),
                                      eq( "baseUrl" ),
                                      any( DeploymentMode.class ) );
    }

    @Test
    public void testInitRepositoryStructure2SingleModuleClashingGAVForced() {
        final GAV gav = new GAV( "groupId",
                                 "artifactId",
                                 "version" );
        final POM pom = new POM( gav );
        final Repository repository = mock( Repository.class );
        final Path repositoryRootPath = mock( Path.class );
        when( repository.getAlias() ).thenReturn( "alias" );
        when( repository.getRoot() ).thenReturn( repositoryRootPath );

        final Project project = mock( Project.class );
        final Path pomPath = mock( Path.class );
        when( project.getPomXMLPath() ).thenReturn( pomPath );

        when( repositoryResolver.getRepositoriesResolvingArtifact( eq( gav ) ) ).thenReturn( new HashSet<MavenRepositoryMetadata>() {
            {
                add( new MavenRepositoryMetadata( "local-id",
                                                  "local-url",
                                                  MavenRepositorySource.LOCAL ) );
            }
        } );

        final GAVAlreadyExistsException gae = new GAVAlreadyExistsException( pom.getGav(),
                                                                             new HashSet<MavenRepositoryMetadata>() {{
                                                                                add( new MavenRepositoryMetadata( "local-id",
                                                                                "local-url",
                                                                                MavenRepositorySource.LOCAL ) );
                                                                             }} );
        doThrow( gae ).when( projectService ).newProject( eq( repository ),
                                                          eq( pom ),
                                                          eq( "baseUrl" ),
                                                          eq( DeploymentMode.VALIDATED ) );
        when( projectService.newProject( eq( repository ),
                                         eq( pom ),
                                         eq( "baseUrl" ),
                                         eq( DeploymentMode.FORCED ) ) ).thenReturn( project );

        try {
            service.initRepositoryStructure( pom,
                                             "baseUrl",
                                             repository,
                                             false,
                                             DeploymentMode.FORCED );

        } catch ( GAVAlreadyExistsException expected ) {
            //This is expected, but we want to verify the other services are not called
        }

        verify( repositoryResolver,
                never() ).getRepositoriesResolvingArtifact( eq( gav ) );

        verify( projectService,
                times( 1 ) ).newProject( eq( repository ),
                                         eq( pom ),
                                         eq( "baseUrl" ),
                                         eq( DeploymentMode.FORCED ) );
    }

    @Test
    public void testInitRepositoryStructure2MultiModule() {
        final GAV gav = new GAV( "groupId",
                                 "artifactId",
                                 "version" );
        final POM pom = new POM( gav );
        final Repository repository = mock( Repository.class );
        final Path repositoryRootPath = mock( Path.class );
        when( repository.getAlias() ).thenReturn( "alias" );
        when( repository.getRoot() ).thenReturn( repositoryRootPath );

        when( repositoryResolver.getRepositoriesResolvingArtifact( eq( gav ) ) ).thenReturn( Collections.<MavenRepositoryMetadata>emptySet() );

        service.initRepositoryStructure( pom,
                                         "baseUrl",
                                         repository,
                                         true,
                                         DeploymentMode.VALIDATED );

        verify( repositoryResolver,
                times( 1 ) ).getRepositoriesResolvingArtifact( eq( gav ) );

        final ArgumentCaptor<POM> pomArgumentCaptor = ArgumentCaptor.forClass( POM.class );
        verify( pomService,
                times( 1 ) ).create( eq( repositoryRootPath ),
                                     eq( "" ),
                                     pomArgumentCaptor.capture() );

        assertNotNull( pomArgumentCaptor.getValue() );
        assertEquals( "groupId",
                      pomArgumentCaptor.getValue().getGav().getGroupId() );
        assertEquals( "artifactId",
                      pomArgumentCaptor.getValue().getGav().getArtifactId() );
        assertEquals( "version",
                      pomArgumentCaptor.getValue().getGav().getVersion() );

        verify( m2service,
                times( 1 ) ).deployParentPom( eq( gav ) );
    }

    @Test
    public void testInitRepositoryStructure2MultiModuleClashingGAV() {
        final GAV gav = new GAV( "groupId",
                                 "artifactId",
                                 "version" );
        final POM pom = new POM( gav );
        final Repository repository = mock( Repository.class );
        final Path repositoryRootPath = mock( Path.class );
        when( repository.getAlias() ).thenReturn( "alias" );
        when( repository.getRoot() ).thenReturn( repositoryRootPath );

        when( repositoryResolver.getRepositoriesResolvingArtifact( eq( gav ) ) ).thenReturn( new HashSet<MavenRepositoryMetadata>() {
            {
                add( new MavenRepositoryMetadata( "local-id",
                                                  "local-url",
                                                  MavenRepositorySource.LOCAL ) );
            }
        } );

        try {
            service.initRepositoryStructure( pom,
                                             "baseUrl",
                                             repository,
                                             true,
                                             DeploymentMode.VALIDATED );

        } catch ( GAVAlreadyExistsException expected ) {
            //This is expected, but we want to verify the other services are not called
        }

        verify( repositoryResolver,
                times( 1 ) ).getRepositoriesResolvingArtifact( eq( gav ) );

        verify( pomService,
                never() ).create( eq( repositoryRootPath ),
                                  eq( "" ),
                                  any( POM.class ) );
        verify( m2service,
                never() ).deployParentPom( eq( gav ) );
    }

    @Test
    public void testInitRepositoryStructure2MultiModuleClashingGAVForced() {
        final GAV gav = new GAV( "groupId",
                                 "artifactId",
                                 "version" );
        final POM pom = new POM( gav );
        final Repository repository = mock( Repository.class );
        final Path repositoryRootPath = mock( Path.class );
        when( repository.getAlias() ).thenReturn( "alias" );
        when( repository.getRoot() ).thenReturn( repositoryRootPath );

        when( repositoryResolver.getRepositoriesResolvingArtifact( eq( gav ) ) ).thenReturn( new HashSet<MavenRepositoryMetadata>() {
            {
                add( new MavenRepositoryMetadata( "local-id",
                                                  "local-url",
                                                  MavenRepositorySource.LOCAL ) );
            }
        } );

        try {
            service.initRepositoryStructure( pom,
                                             "baseUrl",
                                             repository,
                                             true,
                                             DeploymentMode.FORCED );

        } catch ( GAVAlreadyExistsException expected ) {
            //This is expected, but we want to verify the other services are not called
        }

        verify( repositoryResolver,
                never() ).getRepositoriesResolvingArtifact( eq( gav ) );

        final ArgumentCaptor<POM> pomArgumentCaptor = ArgumentCaptor.forClass( POM.class );
        verify( pomService,
                times( 1 ) ).create( eq( repositoryRootPath ),
                                     eq( "" ),
                                     pomArgumentCaptor.capture() );

        assertNotNull( pomArgumentCaptor.getValue() );
        assertEquals( "groupId",
                      pomArgumentCaptor.getValue().getGav().getGroupId() );
        assertEquals( "artifactId",
                      pomArgumentCaptor.getValue().getGav().getArtifactId() );
        assertEquals( "version",
                      pomArgumentCaptor.getValue().getGav().getVersion() );

        verify( m2service,
                times( 1 ) ).deployParentPom( eq( gav ) );
    }

}


text:
package com.mistraltech.smogen.codegenerator.javabuilder;

public class NestedClassBuilder extends AbstractClassBuilder<NestedClassBuilder> {
    private boolean staticFlag;

    private NestedClassBuilder() {
    }

    public static NestedClassBuilder aNestedClass() {
        return new NestedClassBuilder();
    }

    public NestedClassBuilder withStaticFlag(boolean staticFlag) {
        this.staticFlag = staticFlag;
        return this;
    }

    @Override
    protected void writeModifiers(StringBuilder sb) {
        if (getAccessModifier() != null) {
            sb.append(getAccessModifier()).append(" ");
        }

        if (staticFlag) {
            sb.append("static ");
        }

        if (isAbstract()) {
            sb.append("abstract ");
        } else if (isFinal()) {
            sb.append("final ");
        }
    }
}


text:
const init = require('../../configure')
const common = require('../common')
const schema = require('../../../schema')(init)

module.exports = common.Controller(function (params, req, res, next) {
        schema.Article.all({
                where: {category: 'MEISHENG'},
                order: 'datetime desc'
        }).then(function (datalist) {
                schema.Settings.findOne({
                        where: {name: 'GUIDE#' + params.htmlLang}
                }).then(function (data) {
                        data = data || {}
                        var options = init.utils.JSONParse(data.options)

                        var gridview = common.Gridview(datalist, {
                                href: params.cacheKey,
                                fnFormat: function (data) {
                                        return init.utils.update(data, {
                                                href: req.baseUrl + '/a/' + data.num + init.settings.extname,
                                                listVisit: params.listVisit,
                                                datetime: data.datetime.split(' ')[0]
                                        })
                                }
                        }, req, params)

                        if (init.utils.REQUEST(req, 'page')) {
                                return init.renderJSON(res, gridview.datalist)
                        }

                        init.renderCache(res, 'listpage/guide', init.utils.update(params, {
                                mainTitle: params.nav['n201'],
                                gridview: gridview,
                                guide: {
                                        title: options['guide_title']
                                }
                        }))
                })
        })
})


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.labservices.models;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/** The operating system type. */
public enum OsType {
    /** Enum value Windows. */
    WINDOWS("Windows"),

    /** Enum value Linux. */
    LINUX("Linux");

    /** The actual serialized value for a OsType instance. */
    private final String value;

    OsType(String value) {
        this.value = value;
    }

    /**
     * Parses a serialized value to a OsType instance.
     *
     * @param value the serialized value to parse.
     * @return the parsed OsType object, or null if unable to parse.
     */
    @JsonCreator
    public static OsType fromString(String value) {
        if (value == null) {
            return null;
        }
        OsType[] items = OsType.values();
        for (OsType item : items) {
            if (item.toString().equalsIgnoreCase(value)) {
                return item;
            }
        }
        return null;
    }

    /** {@inheritDoc} */
    @JsonValue
    @Override
    public String toString() {
        return this.value;
    }
}