It happends that the factory get called with properties that only contain
service.pid and service.factoryPid. If that happens we don't want to create
an engine.

@param properties
@return
483226
@SuppressWarnings("unchecked")
  private boolean hasPropertiesConfiguration(Dictionary properties) {
    HashMap<Object, Object> mapProperties = new HashMap<Object, Object>(properties.size());
    for (Object key : Collections.list(properties.keys())) {
      mapProperties.put(key, properties.get(key));
    }
    mapProperties.remove(Constants.SERVICE_PID);
    mapProperties.remove("service.factoryPid");
    return !mapProperties.isEmpty();
  }
117338
protected synchronized PrefixedProperties createProperties() {
		if (myProperties == null) {
			PrefixedProperties resultProperties = null;
			String environment = defaultPrefix;
			if (environmentFactory != null) {
				environment = environmentFactory.getEnvironment();
			} else if (defaultPrefixSystemPropertyKey != null) {
				environment = System.getProperty(defaultPrefixSystemPropertyKey);
				if (environment == null) {
					if (logger.isWarnEnabled()) {
						logger.warn(String.format("Didn't found system property key to set default prefix: %1s",
								defaultPrefixSystemPropertyKey));
					}
				}
			}
			if (prefixConfigList != null) {
				resultProperties = PrefixedProperties.createCascadingPrefixProperties(prefixConfigList);
			} else {
				if (environment != null) {
					resultProperties = PrefixedProperties.createCascadingPrefixProperties(environment);
				} else {
					resultProperties = new PrefixedProperties();
				}
			}
			resultProperties.setDefaultPrefix(environment);
			if (logger.isInfoEnabled()) {
				logger.info(String.format("Setting default prefix to: %1s", environment));
			}
			resultProperties.setMixDefaultAndLocalPrefixSettings(mixDefaultAndLocalPrefixConfigurations);
			myProperties = resultProperties;
		}
		return myProperties;
	}
112683
public static ConfigID fromProperty(String property) {
        //TODO Perhaps there is a clever regex that could handle this
        String[] parents = property.split("//");

        ConfigID id = null;
        for (String parentString : parents) {
            id = constructId(id, parentString);
        }

        return id;
    }
129140
public static DatabaseEngine getConnection(Properties p) throws DatabaseFactoryException {
        PdbProperties pdbProperties = new PdbProperties(p, true);
        final String engine = pdbProperties.getEngine();

        if (StringUtils.isBlank(engine)) {
            throw new DatabaseFactoryException("pdb.engine property is mandatory");
        }

        try {
            Class<?> c = Class.forName(engine);

            Constructor cons = c.getConstructor(PdbProperties.class);
            final AbstractDatabaseEngine de = (AbstractDatabaseEngine) cons.newInstance(pdbProperties);

            Class<? extends AbstractTranslator> tc = de.getTranslatorClass();

            if (pdbProperties.isTranslatorSet()) {
                final Class<?> propertiesTranslator = Class.forName(pdbProperties.getTranslator());
                if (!AbstractTranslator.class.isAssignableFrom(propertiesTranslator)) {
                    throw new DatabaseFactoryException("Provided translator does extend from AbstractTranslator.");
                }

                tc = (Class<? extends AbstractTranslator>) propertiesTranslator;
            }


            final Injector injector = Guice.createInjector(
                    new PdbModule.Builder()
                            .withTranslator(tc)
                            .withPdbProperties(pdbProperties)
                            .build());
            injector.injectMembers(de);

            return de;
        } catch (final DatabaseFactoryException e) {
            throw e;
        } catch (final Exception e) {
            throw new DatabaseFactoryException(e);
        }
    }
990805
static Properties getSystemProperties()
   {
      return (Properties)AccessController.doPrivileged(new PrivilegedAction<Object>() 
      {
         public Object run()
         {
            return System.getProperties();
         }
      });
   }
26026
@VisibleForTesting
    AbstractConfiguration createConfiguration(Properties properties) {

        CompositeConfiguration composite = new CompositeConfiguration();

        ConfigurationType[] types = ConfigurationType.values();

        Arrays.stream(types).forEach(s -> s.get().ifPresent(composite::addConfiguration));

        Optional.ofNullable(properties).ifPresent(p -> composite.addConfiguration(new MapConfiguration(p)));

        return composite;

    }
137609
public KafkaClient setConsumerProperties(Properties props) {
        if (props == null) {
            consumerProperties = null;
        } else {
            consumerProperties = new Properties();
            consumerProperties.putAll(props);
        }
        return this;
    }
551678
public KafkaEndpointBuilder consumerProperties(Map<String, Object> consumerProperties) {
        endpoint.getEndpointConfiguration().setConsumerProperties(consumerProperties);
        return this;
    }
484590
public static ConfigurationOption factoryConfiguration(String pid) {
        return new org.ops4j.pax.exam.cm.internal.ConfigurationProvisionOption(pid, new HashMap<String, Object>()).factory(true);
    }
186706
public PropertySet removeAll( Iterator<String> properties)
    {
    if( properties != null)
      {
      while( properties.hasNext())
        {
        remove( properties.next());
        }
      }
    
    return this;
    }
806460
public Map<String, Object> getApplicationProperties(Map<String, Object> properties)
    {
        if (properties == null)
            return null;
        Map<String, Object> propApp = new Hashtable<String,Object>();
        if (properties.get(DBParams.LANGUAGE) != null)
            propApp.put(DBParams.LANGUAGE, properties.get(DBParams.LANGUAGE));
        if (properties.get(DBParams.DOMAIN) != null)
            propApp.put(DBParams.DOMAIN, properties.get(DBParams.DOMAIN));
        return propApp;
    }
364025
public List<String> getRunningServiceIds() {
        List<ServiceReference<Domain>> serviceReferences = osgiUtilsService.listServiceReferences(Domain.class);
        List<String> result = new ArrayList<String>();
        for (ServiceReference<Domain> ref : serviceReferences) {
            result.add((String) ref.getProperty(org.osgi.framework.Constants.SERVICE_PID));
        }
        return result;
    }
644223
public List<PropertyType<ConnectionFactoryResourceType<T>>> getAllProperty()
   {
      List<PropertyType<ConnectionFactoryResourceType<T>>> list = new ArrayList<PropertyType<ConnectionFactoryResourceType<T>>>();
      List<Node> nodeList = childNode.get("property");
      for(Node node: nodeList)
      {
         PropertyType<ConnectionFactoryResourceType<T>>  type = new PropertyTypeImpl<ConnectionFactoryResourceType<T>>(this, "property", childNode, node);
         list.add(type);
      }
      return list;
   }
143648
@Trivial
    public final Map<String, String> getExecutionProperties() {
        TreeMap<String, String> copy = null;
        if (internalPropNames != null) {
            copy = new TreeMap<String, String>(threadContextDescriptor.getExecutionProperties());
            for (String name : internalPropNames)
                copy.remove(name);
        }
        return copy;
    }
327504
public Bitflyer4j createInstance(Properties properties) {

        log.info("Creating instance.");

        final AbstractConfiguration conf = createConfiguration(properties);

        final Class<? extends RealtimeService> realtimeClass = getRealtimeType(conf);

        Module module = new AbstractModule() {
            @Override
            protected void configure() {

                bind(Configuration.class).toInstance(conf);

                bind(EventSource.class).toInstance(conf);

                bind(Gson.class).toProvider(GsonProvider.class).asEagerSingleton();

                bind(PubNub.class).toProvider(PubNubProvider.class).asEagerSingleton();

                bind(Socket.class).toProvider(SocketProvider.class).asEagerSingleton();

                bind(Environment.class).to(EnvironmentImpl.class).asEagerSingleton();

                bind(Throttler.class).to(ThrottlerImpl.class).asEagerSingleton();

                bind(ExecutorFactory.class).to(ExecutorFactoryImpl.class).asEagerSingleton();

                bind(HttpClient.class).to(HttpClientImpl.class).asEagerSingleton();

                bind(Bitflyer4j.class).to(Bitflyer4jImpl.class).asEagerSingleton();

                bind(MarketService.class).to(MarketServiceImpl.class).asEagerSingleton();

                bind(AccountService.class).to(AccountServiceImpl.class).asEagerSingleton();

                bind(OrderService.class).to(OrderServiceImpl.class).asEagerSingleton();

                bind(RealtimeService.class).to(realtimeClass).asEagerSingleton();

            }
        };

        return Guice.createInjector(module).getInstance(Bitflyer4j.class);

    }
1320
public Properties asProperties() {
        final Properties props = new Properties();
        other.forEach(props::setProperty);
        props.setProperty("bootstrap.servers", bootstrapServers);
        return props;
    }
858890
public static List<Connector> createDefaultConnectors(Map<String, Object> properties) {
        List<Connector> connectors = Lists.newArrayList();
        Map<String, Map<String, String>> propertiesMap = Maps.newLinkedHashMap();
        for (String key : properties.keySet()) {
            if (key.startsWith(Connector.CONNECTOR_CONF_PREFIX)) {
                String oKey = key;
                key = key.substring(Connector.CONNECTOR_CONF_PREFIX.length());
                int index = key.indexOf(".");
                if (index == -1) {
                    throw new ConfigErrorException("connector configure error, format connector.{connectorName}.{property}");
                }
                String name = key.substring(0, index);
                Map<String, String> pr = propertiesMap.get(name);
                if (pr == null) {
                    pr = Maps.newLinkedHashMap();
                    propertiesMap.put(name, pr);
                    pr.put("name", name);
                }
                pr.put(key.substring(index + 1), String.valueOf(properties.get(oKey)));
            }
        }

        connectors.addAll(propertiesMap.values().stream().map(Connector::createDefault).collect(Collectors.toList()));
        return connectors;
    }