text:
package org.batfish.coordinator;

import static com.google.common.base.Preconditions.checkState;
import static java.nio.file.FileVisitOption.FOLLOW_LINKS;

import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Throwables;
import com.google.common.collect.Lists;
import io.jaegertracing.Configuration;
import io.jaegertracing.Configuration.ReporterConfiguration;
import io.jaegertracing.Configuration.SamplerConfiguration;
import io.jaegertracing.Configuration.SenderConfiguration;
import io.opentracing.contrib.jaxrs2.server.ServerTracingDynamicFeature;
import io.opentracing.util.GlobalTracer;
import java.io.IOException;
import java.net.URI;
import java.nio.file.FileVisitResult;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.SimpleFileVisitor;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.CompletableFuture;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.Nullable;
import javax.ws.rs.core.UriBuilder;
import org.batfish.common.BatfishException;
import org.batfish.common.BatfishLogger;
import org.batfish.common.BfConsts;
import org.batfish.common.util.BatfishObjectMapper;
import org.batfish.common.util.BindPortFutures;
import org.batfish.common.util.CommonUtil;
import org.batfish.coordinator.authorizer.Authorizer;
import org.batfish.coordinator.authorizer.DbAuthorizer;
import org.batfish.coordinator.authorizer.FileAuthorizer;
import org.batfish.coordinator.authorizer.NoneAuthorizer;
import org.batfish.coordinator.config.ConfigurationLocator;
import org.batfish.coordinator.config.Settings;
import org.batfish.coordinator.id.StorageBasedIdManager;
import org.batfish.datamodel.questions.InstanceData;
import org.batfish.storage.FileBasedStorage;
import org.codehaus.jettison.json.JSONException;
import org.codehaus.jettison.json.JSONObject;
import org.glassfish.grizzly.http.server.HttpServer;
import org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory;
import org.glassfish.jersey.jackson.JacksonFeature;
import org.glassfish.jersey.jettison.JettisonFeature;
import org.glassfish.jersey.media.multipart.MultiPartFeature;
import org.glassfish.jersey.server.ResourceConfig;

public class Main {

  // These are all @Nullable because they are static and may not be initialized if Main() has not
  // been called.
  private static @Nullable Authorizer _authorizer;
  private static @Nullable BatfishLogger _logger;
  private static @Nullable PoolMgr _poolManager;
  private static @Nullable Settings _settings;
  private static @Nullable WorkMgr _workManager;

  static Logger httpServerLogger = Logger.getLogger(HttpServer.class.getName());
  static Logger networkListenerLogger =
      Logger.getLogger(org.glassfish.grizzly.http.server.NetworkListener.class.getName());

  public static Authorizer getAuthorizer() {
    checkState(_authorizer != null, "Error: Authorizer has not been configured");
    return _authorizer;
  }

  public static BatfishLogger getLogger() {
    checkState(_logger != null, "Error: Logger has not been configured");
    return _logger;
  }

  public static PoolMgr getPoolMgr() {
    checkState(_poolManager != null, "Error: Pool Manager has not been configured");
    return _poolManager;
  }

  @Nullable
  public static Map<String, String> getQuestionTemplates() {
    return getQuestionTemplates(false);
  }

  /**
   * Returns content of question templates, keyed by name. If {@code verbose} is {@code true},
   * includes hidden templates. Returns {@code null} if question templates not configured.
   */
  @Nullable
  public static Map<String, String> getQuestionTemplates(boolean verbose) {
    List<Path> questionTemplateDir = _settings.getQuestionTemplateDirs();
    if (questionTemplateDir == null || questionTemplateDir.isEmpty()) {
      return null;
    }

    Map<String, String> questionTemplates = new HashMap<>();
    questionTemplateDir.stream()
        .filter(Objects::nonNull)
        .filter(dir -> !dir.toString().isEmpty())
        .forEach((dir) -> readQuestionTemplates(dir, questionTemplates));
    if (!verbose) {
      questionTemplates.keySet().removeIf(Main::isHiddenQuestionTemplate);
    }
    return questionTemplates;
  }

  static boolean isHiddenQuestionTemplate(String name) {
    return name.startsWith("__");
  }

  @VisibleForTesting
  static String readQuestionTemplate(Path file, Map<String, String> templates)
      throws JSONException, IOException {
    String questionText = CommonUtil.readFile(file);
    JSONObject questionObj = new JSONObject(questionText);
    if (questionObj.has(BfConsts.PROP_INSTANCE) && !questionObj.isNull(BfConsts.PROP_INSTANCE)) {
      JSONObject instanceDataObj = questionObj.getJSONObject(BfConsts.PROP_INSTANCE);
      String instanceDataStr = instanceDataObj.toString();
      InstanceData instanceData =
          BatfishObjectMapper.mapper().readValue(instanceDataStr, InstanceData.class);
      String name = instanceData.getInstanceName();
      String key = name.toLowerCase();
      if (templates.containsKey(key) && _logger != null) {
        _logger.warnf(
            "Found duplicate template having instance name %s, only the last one in the list of"
                + " templatedirs will be loaded\n",
            name);
      }

      templates.put(key, questionText);
      return name;
    } else {
      throw new BatfishException(String.format("Question in file:%s has no instance name", file));
    }
  }

  @VisibleForTesting
  static void readQuestionTemplates(Path questionsPath, Map<String, String> templates) {
    try {
      Files.walkFileTree(
          questionsPath,
          EnumSet.of(FOLLOW_LINKS),
          Integer.MAX_VALUE,
          new SimpleFileVisitor<Path>() {
            @Override
            public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {
              String filename = file.getFileName().toString();
              if (filename.endsWith(".json")) {
                try {
                  readQuestionTemplate(file, templates);
                } catch (Exception e) {
                  _logger.errorf(
                      "Failed to read question template from '%s': %s",
                      file, Throwables.getStackTraceAsString(e));
                }
              }
              return FileVisitResult.CONTINUE;
            }
          });
    } catch (IOException e) {
      throw new BatfishException("Failed to visit templates dir: " + questionsPath, e);
    }
  }

  public static Settings getSettings() {
    checkState(_settings != null, "Error: Coordinator settings have not been configured");
    return _settings;
  }

  public static WorkMgr getWorkMgr() {
    checkState(_workManager != null, "Error: Work Manager has not been configured");
    return _workManager;
  }

  public static void setLogger(BatfishLogger logger) {
    _logger = logger;
  }

  public static void setWorkMgr(WorkMgr workManager) {
    _workManager = workManager;
  }

  public static void setAuthorizer(Authorizer authorizer) {
    _authorizer = authorizer;
  }

  static void initAuthorizer() {
    Settings settings = getSettings();
    Authorizer.Type type = settings.getAuthorizationType();
    switch (type) {
      case none:
        _authorizer = NoneAuthorizer.INSTANCE;
        break;
      case file:
        _authorizer = FileAuthorizer.createFromSettings(settings);
        break;
      case database:
        _authorizer = DbAuthorizer.createFromSettings(settings);
        break;
      default:
        System.err.print(
            "org.batfish.coordinator: Initialization failed. Unsupported authorizer type " + type);
        System.exit(1);
    }
    getLogger().infof("Using authorizer %s\n", _authorizer);
  }

  private static void initPoolManager(BindPortFutures bindPortFutures) {
    ResourceConfig rcPool =
        new ResourceConfig(PoolMgrService.class)
            .register(new JettisonFeature())
            .register(MultiPartFeature.class);
    HttpServer server;
    if (_settings.getSslPoolDisable()) {
      URI poolMgrUri =
          UriBuilder.fromUri("http://" + _settings.getPoolBindHost())
              .port(_settings.getServicePoolPort())
              .build();

      _logger.infof("Starting pool manager at %s\n", poolMgrUri);

      server = GrizzlyHttpServerFactory.createHttpServer(poolMgrUri, rcPool);
    } else {
      URI poolMgrUri =
          UriBuilder.fromUri("https://" + _settings.getPoolBindHost())
              .port(_settings.getServicePoolPort())
              .build();

      _logger.infof("Starting pool manager at %s\n", poolMgrUri);

      server =
          CommonUtil.startSslServer(
              rcPool,
              poolMgrUri,
              _settings.getSslPoolKeystoreFile(),
              _settings.getSslPoolKeystorePassword(),
              _settings.getSslPoolTrustAllCerts(),
              _settings.getSslPoolTruststoreFile(),
              _settings.getSslPoolTruststorePassword(),
              ConfigurationLocator.class,
              Main.class);
    }

    _poolManager = new PoolMgr(_settings, _logger);
    _poolManager.startPoolManager();
    int selectedListenPort = server.getListeners().iterator().next().getPort();
    URI actualPoolMgrUri =
        UriBuilder.fromUri("http://" + _settings.getPoolBindHost())
            .port(selectedListenPort)
            .build();
    _logger.infof("Started pool manager at %s\n", actualPoolMgrUri);
    if (!bindPortFutures.getPoolPort().isDone()) {
      bindPortFutures.getPoolPort().complete(selectedListenPort);
    }
  }

  private static void startWorkManagerService(
      Class<?> serviceClass,
      List<Class<?>> features,
      int port,
      CompletableFuture<Integer> portFuture) {
    ResourceConfig rcWork = new ResourceConfig(serviceClass).register(ExceptionMapper.class);
    if (_settings.getTracingEnable()) {
      _logger.infof("Registering feature %s", ServerTracingDynamicFeature.class.getSimpleName());
      rcWork.register(ServerTracingDynamicFeature.class);
    }
    for (Class<?> feature : features) {
      _logger.infof("Registering feature %s", feature.getSimpleName());
      rcWork.register(feature);
    }

    HttpServer server;
    if (_settings.getSslWorkDisable()) {
      URI workMgrUri =
          UriBuilder.fromUri("http://" + _settings.getWorkBindHost()).port(port).build();

      _logger.infof("Starting work manager %s at %s\n", serviceClass, workMgrUri);

      server = GrizzlyHttpServerFactory.createHttpServer(workMgrUri, rcWork);
    } else {
      URI workMgrUri =
          UriBuilder.fromUri("https://" + _settings.getWorkBindHost()).port(port).build();

      _logger.infof("Starting work manager at %s\n", workMgrUri);
      server =
          CommonUtil.startSslServer(
              rcWork,
              workMgrUri,
              _settings.getSslWorkKeystoreFile(),
              _settings.getSslWorkKeystorePassword(),
              _settings.getSslWorkTrustAllCerts(),
              _settings.getSslWorkTruststoreFile(),
              _settings.getSslWorkTruststorePassword(),
              ConfigurationLocator.class,
              Main.class);
    }
    int selectedListenPort = server.getListeners().iterator().next().getPort();
    URI actualWorkMgrUri =
        UriBuilder.fromUri("http://" + _settings.getWorkBindHost())
            .port(selectedListenPort)
            .build();
    _logger.infof("Started work manager at %s\n", actualWorkMgrUri);
    if (!portFuture.isDone()) {
      portFuture.complete(selectedListenPort);
    }
  }

  private static void initTracer() {
    Configuration config =
        new Configuration(_settings.getServiceName())
            .withSampler(new SamplerConfiguration().withType("const").withParam(1))
            .withReporter(
                new ReporterConfiguration()
                    .withSender(
                        SenderConfiguration.fromEnv()
                            .withAgentHost(_settings.getTracingAgentHost())
                            .withAgentPort(_settings.getTracingAgentPort()))
                    .withLogSpans(false));
    GlobalTracer.registerIfAbsent(config.getTracer());
  }

  private static void initWorkManager(BindPortFutures bindPortFutures) {
    FileBasedStorage fbs = new FileBasedStorage(_settings.getContainersLocation(), _logger);
    _workManager = new WorkMgr(_settings, _logger, new StorageBasedIdManager(fbs), fbs);
    _workManager.startWorkManager();
    // Initialize and start the work manager service using the legacy API and Jettison.
    startWorkManagerService(
        WorkMgrService.class,
        Lists.newArrayList(JettisonFeature.class, MultiPartFeature.class),
        _settings.getServiceWorkPort(),
        bindPortFutures.getWorkPort());
    // Initialize and start the work manager service using the v2 RESTful API and Jackson.

    startWorkManagerService(
        WorkMgrServiceV2.class,
        Lists.newArrayList(
            ServiceObjectMapper.class,
            JacksonFeature.class,
            ApiKeyAuthenticationFilter.class,
            VersionCompatibilityFilter.class),
        _settings.getServiceWorkV2Port(),
        bindPortFutures.getWorkV2Port());
  }

  public static void main(String[] args, BatfishLogger logger, BindPortFutures portFutures) {
    mainInit(args);

    // Supply ports early if known before binding
    int configuredPoolPort = _settings.getServicePoolPort();
    if (configuredPoolPort > 0) {
      portFutures.getPoolPort().complete(configuredPoolPort);
    }
    int configuredWorkPort = _settings.getServiceWorkPort();
    if (configuredWorkPort > 0) {
      portFutures.getWorkPort().complete(configuredWorkPort);
    }
    int configuredWorkV2Port = _settings.getServiceWorkV2Port();
    if (configuredWorkV2Port > 0) {
      portFutures.getWorkV2Port().complete(configuredWorkV2Port);
    }

    _logger = logger;
    mainRun(portFutures);
  }

  public static void mainInit(String[] args) {
    _settings = null;
    try {
      _settings = new Settings(args);
      networkListenerLogger.setLevel(Level.WARNING);
      httpServerLogger.setLevel(Level.WARNING);
    } catch (Exception e) {
      System.err.print(
          "org.batfish.coordinator: Initialization failed: " + Throwables.getStackTraceAsString(e));
      System.exit(1);
    }
  }

  private static void mainRun(BindPortFutures portFutures) {
    try {
      initAuthorizer();
      initPoolManager(portFutures);
      if (_settings.getTracingEnable() && !GlobalTracer.isRegistered()) {
        initTracer();
      }
      initWorkManager(portFutures);
    } catch (Exception e) {
      System.err.println(
          "org.batfish.coordinator: Initialization of a helper failed: "
              + Throwables.getStackTraceAsString(e));
      System.exit(1);
    }

    // run GC on startup
    _workManager.triggerGarbageCollection();

    // sleep indefinitely, in 10 minute chunks
    try {
      while (true) {
        Thread.sleep(10 * 60 * 1000); // 10 minutes
        _logger.info("Still alive .... waiting for work to show up\n");
      }
    } catch (Exception ex) {
      String stackTrace = Throwables.getStackTraceAsString(ex);
      System.err.println(stackTrace);
    }
  }
}


text:
package org.onosproject.rabbitmq.api;

import java.util.Map;
import java.util.concurrent.BlockingQueue;

import org.onosproject.rabbitmq.impl.BrokerHost;
import org.onosproject.rabbitmq.impl.MessageContext;

/**
 * API for registering producer with server.
 */
public interface MQTransport {
    /**
     * Registers MQ client with the server.
     *
     * @param host the broker host
     * @param channelConf the mq channel configurations
     * @param queue the message context
     * @return the sender handle
     */
    Manageable registerProducer(BrokerHost host, Map<String, String> channelConf,
            BlockingQueue<MessageContext> queue);

}

redpajama_set_name: RedPajamaGithub


text:
@implementation ACTranslateManager

static ACTranslateManager *instance = nil;
+ (instancetype)shareManager
{
    if (instance == nil) {
        instance = [[ACTranslateManager alloc] init];
    }
    return instance;
}

- (BOOL)isChineseInString:(NSString *)orgStr
{
//    NSUInteger hanCount = 0;
//    NSUInteger yinCount = 0;

    for (NSUInteger i = 0; i < orgStr.length; i++) {
        unichar c = [orgStr characterAtIndex:i];
        if (c >=0x4E00 && c <=0x9FFF)
        {
            return YES;
//            hanCount ++;
        }
        else
        {
//            yinCount ++;
        }
    }

    return NO;
}

- (void)translateWithOrgString:(NSString *)orgStr withResult:(translateBlock)resStr
{
    [[ACNetWorkManager shareManager] youdaoTranslaterWithStr:orgStr thatResult:^(RACTuple *resData) {
        RACTupleUnpack(NSHTTPURLResponse *response,NSData *data) = resData;

        NSString *content = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
        //                        状态码
        NSLog(@"%ld",(long)response.statusCode);

        NSLog(@"%@",content);

        NSDictionary *initDic = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];

        NSString *transStr = initDic[@"translation"][0];

        resStr(transStr);
    }];
}

@end


text:
typedef NS_ENUM(NSInteger, MMRErrorCodes) {
    MMRErrorUnknown = 1,
    MMRErrorUnknownMethodCalled = 2,
    MMRErrorServiceUnavailable = 3,
    MMRErrorMethodDeprecated = 4,
    MMRErrorParameterMissingOrInvalid = 100,
    MMRErrorUserAuthorizationFailed = 102,
    MMRErrorApplicationLookupFailed = 103,
    MMRErrorIncorrectSignature = 104,
    MMRErrorApplicationNotInstalledForUser = 105,
    MMRErrorPermissionError = 200,
    MMRErrorUserCancelOperation = -101
};

@interface MMRErrorUtility : NSObject

+ (NSError *)errorFromJSON:(id)json;
+ (NSError *)errorForCode:(MMRErrorCodes)errorCode;

@end


text:
package io.jenetics.engine;

import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.io.Serial;
import java.io.StreamCorruptedException;

/**
 * @author Franz Wilhelmstötter
 * @version 5.2
 * @since 5.2
 */
final class SerialProxy implements Externalizable {

	@Serial
	private static final long serialVersionUID = 1;

	static final byte EVOLUTION_DURATIONS = 1;
	static final byte EVOLUTION_INIT = 2;
	static final byte EVOLUTION_PARAMS = 3;
	static final byte EVOLUTION_RESULT = 4;
	static final byte EVOLUTION_START = 5;

	/**
	 * The type being serialized.
	 */
	private byte _type;

	/**
	 * The object being serialized.
	 */
	private Object _object;

	/**
	 * Constructor for deserialization.
	 */
	public SerialProxy() {
	}

	/**
	 * Creates an instance for serialization.
	 *
	 * @param type  the type
	 * @param object  the object
	 */
	SerialProxy(final byte type, final Object object) {
		_type = type;
		_object = object;
	}

	@Override
	public void writeExternal(final ObjectOutput out) throws IOException {
		out.writeByte(_type);
		switch (_type) {
			case EVOLUTION_DURATIONS -> ((EvolutionDurations)_object).write(out);
			case EVOLUTION_INIT -> ((EvolutionInit<?>)_object).write(out);
			case EVOLUTION_PARAMS -> ((EvolutionParams<?, ?>)_object).write(out);
			case EVOLUTION_RESULT -> ((EvolutionResult<?, ?>)_object).write(out);
			case EVOLUTION_START -> ((EvolutionStart<?, ?>)_object).write(out);
			default -> throw new StreamCorruptedException("Unknown serialized type.");
		}
	}

	@Override
	public void readExternal(final ObjectInput in)
		throws IOException, ClassNotFoundException
	{
		_type = in.readByte();
		_object = switch (_type) {
			case EVOLUTION_DURATIONS -> EvolutionDurations.read(in);
			case EVOLUTION_INIT -> EvolutionInit.read(in);
			case EVOLUTION_PARAMS -> EvolutionParams.read(in);
			case EVOLUTION_RESULT -> EvolutionResult.read(in);
			case EVOLUTION_START -> EvolutionStart.read(in);
			default -> throw new StreamCorruptedException("Unknown serialized type.");
		};
	}

	@Serial
	private Object readResolve() {
		return _object;
	}

}


text:
package com.amazonaws.services.identitymanagement.model;

import java.io.Serializable;

import com.amazonaws.AmazonWebServiceRequest;

/**
 * Container for the parameters to the {@link com.amazonaws.services.identitymanagement.AmazonIdentityManagement#updateAccountPasswordPolicy(UpdateAccountPasswordPolicyRequest) UpdateAccountPasswordPolicy operation}.
 *

 * Updates the password policy settings for the AWS account.
 *

 *

 * NOTE: This action does not support partial updates. No
 * parameters are required, but if you do not specify a parameter, that
 * parameter's value reverts to its default value. See the Request
 * Parameters section for each parameter's default value.
 *

 *

 * For more information about using a password policy, see
 *  Managing an IAM Password Policy
 * in the Using IAM guide.
 *

 *
 * @see com.amazonaws.services.identitymanagement.AmazonIdentityManagement#updateAccountPasswordPolicy(UpdateAccountPasswordPolicyRequest)
 */
public class UpdateAccountPasswordPolicyRequest extends AmazonWebServiceRequest implements Serializable, Cloneable {

    /**
     * The minimum number of characters allowed in an IAM user password.
     *
Default value: 6
     *

     * Constraints:

     * Range: 6 - 128

     */
    private Integer minimumPasswordLength;

    /**
     * Specifies whether IAM user passwords must contain at least one of the
     * following non-alphanumeric characters:
! @ # $ % ^ & * ( ) _ + - =
     * [ ] { } | '
Default value: false
     */
    private Boolean requireSymbols;

    /**
     * Specifies whether IAM user passwords must contain at least one numeric
     * character (0 to 9).
Default value: false
     */
    private Boolean requireNumbers;

    /**
     * Specifies whether IAM user passwords must contain at least one
     * uppercase character from the ISO basic Latin alphabet (A to Z).
     *
Default value: false
     */
    private Boolean requireUppercaseCharacters;

    /**
     * Specifies whether IAM user passwords must contain at least one
     * lowercase character from the ISO basic Latin alphabet (a to z).
     *
Default value: false
     */
    private Boolean requireLowercaseCharacters;

    /**
     * Allows all IAM users in your account to use the AWS Management Console
     * to change their own passwords. For more information, see Letting
     * IAM Users Change Their Own Passwords in the Using IAM
     * guide.
Default value: false
     */
    private Boolean allowUsersToChangePassword;

    /**
     * The number of days that an IAM user password is valid. The default
     * value of 0 means IAM user passwords never expire.
Default value: 0
     *

     * Constraints:

     * Range: 1 - 1095

     */
    private Integer maxPasswordAge;

    /**
     * Specifies the number of previous passwords that IAM users are
     * prevented from reusing. The default value of 0 means IAM users are not
     * prevented from reusing previous passwords.
Default value: 0
     *

     * Constraints:

     * Range: 1 - 24

     */
    private Integer passwordReusePrevention;

    /**
     * Prevents IAM users from setting a new password after their password
     * has expired.
Default value: false
     */
    private Boolean hardExpiry;

    /**
     * The minimum number of characters allowed in an IAM user password.
     *
Default value: 6
     *

     * Constraints:

     * Range: 6 - 128

     *
     * @return The minimum number of characters allowed in an IAM user password.
     *
Default value: 6
     */
    public Integer getMinimumPasswordLength() {
        return minimumPasswordLength;
    }

    /**
     * The minimum number of characters allowed in an IAM user password.
     *
Default value: 6
     *

     * Constraints:

     * Range: 6 - 128

     *
     * @param minimumPasswordLength The minimum number of characters allowed in an IAM user password.
     *
Default value: 6
     */
    public void setMinimumPasswordLength(Integer minimumPasswordLength) {
        this.minimumPasswordLength = minimumPasswordLength;
    }

    /**
     * The minimum number of characters allowed in an IAM user password.
     *
Default value: 6
     *

     * Returns a reference to this object so that method calls can be chained together.
     *

     * Constraints:

     * Range: 6 - 128

     *
     * @param minimumPasswordLength The minimum number of characters allowed in an IAM user password.
     *
Default value: 6
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public UpdateAccountPasswordPolicyRequest withMinimumPasswordLength(Integer minimumPasswordLength) {
        this.minimumPasswordLength = minimumPasswordLength;
        return this;
    }

    /**
     * Specifies whether IAM user passwords must contain at least one of the
     * following non-alphanumeric characters:
! @ # $ % ^ & * ( ) _ + - =
     * [ ] { } | '
Default value: false
     *
     * @return Specifies whether IAM user passwords must contain at least one of the
     *         following non-alphanumeric characters:
! @ # $ % ^ & * ( ) _ + - =
     *         [ ] { } | '
Default value: false
     */
    public Boolean isRequireSymbols() {
        return requireSymbols;
    }

    /**
     * Specifies whether IAM user passwords must contain at least one of the
     * following non-alphanumeric characters:
! @ # $ % ^ & * ( ) _ + - =
     * [ ] { } | '
Default value: false
     *
     * @param requireSymbols Specifies whether IAM user passwords must contain at least one of the
     *         following non-alphanumeric characters:
! @ # $ % ^ & * ( ) _ + - =
     *         [ ] { } | '
Default value: false
     */
    public void setRequireSymbols(Boolean requireSymbols) {
        this.requireSymbols = requireSymbols;
    }

    /**
     * Specifies whether IAM user passwords must contain at least one of the
     * following non-alphanumeric characters:
! @ # $ % ^ & * ( ) _ + - =
     * [ ] { } | '
Default value: false
     *

     * Returns a reference to this object so that method calls can be chained together.
     *
     * @param requireSymbols Specifies whether IAM user passwords must contain at least one of the
     *         following non-alphanumeric characters:
! @ # $ % ^ & * ( ) _ + - =
     *         [ ] { } | '
Default value: false
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public UpdateAccountPasswordPolicyRequest withRequireSymbols(Boolean requireSymbols) {
        this.requireSymbols = requireSymbols;
        return this;
    }

    /**
     * Specifies whether IAM user passwords must contain at least one of the
     * following non-alphanumeric characters:
! @ # $ % ^ & * ( ) _ + - =
     * [ ] { } | '
Default value: false
     *
     * @return Specifies whether IAM user passwords must contain at least one of the
     *         following non-alphanumeric characters:
! @ # $ % ^ & * ( ) _ + - =
     *         [ ] { } | '
Default value: false
     */
    public Boolean getRequireSymbols() {
        return requireSymbols;
    }

    /**
     * Specifies whether IAM user passwords must contain at least one numeric
     * character (0 to 9).
Default value: false
     *
     * @return Specifies whether IAM user passwords must contain at least one numeric
     *         character (0 to 9).
Default value: false
     */
    public Boolean isRequireNumbers() {
        return requireNumbers;
    }

    /**
     * Specifies whether IAM user passwords must contain at least one numeric
     * character (0 to 9).
Default value: false
     *
     * @param requireNumbers Specifies whether IAM user passwords must contain at least one numeric
     *         character (0 to 9).
Default value: false
     */
    public void setRequireNumbers(Boolean requireNumbers) {
        this.requireNumbers = requireNumbers;
    }

    /**
     * Specifies whether IAM user passwords must contain at least one numeric
     * character (0 to 9).
Default value: false
     *

     * Returns a reference to this object so that method calls can be chained together.
     *
     * @param requireNumbers Specifies whether IAM user passwords must contain at least one numeric
     *         character (0 to 9).
Default value: false
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public UpdateAccountPasswordPolicyRequest withRequireNumbers(Boolean requireNumbers) {
        this.requireNumbers = requireNumbers;
        return this;
    }

    /**
     * Specifies whether IAM user passwords must contain at least one numeric
     * character (0 to 9).
Default value: false
     *
     * @return Specifies whether IAM user passwords must contain at least one numeric
     *         character (0 to 9).
Default value: false
     */
    public Boolean getRequireNumbers() {
        return requireNumbers;
    }

    /**
     * Specifies whether IAM user passwords must contain at least one
     * uppercase character from the ISO basic Latin alphabet (A to Z).
     *
Default value: false
     *
     * @return Specifies whether IAM user passwords must contain at least one
     *         uppercase character from the ISO basic Latin alphabet (A to Z).
     *
Default value: false
     */
    public Boolean isRequireUppercaseCharacters() {
        return requireUppercaseCharacters;
    }

    /**
     * Specifies whether IAM user passwords must contain at least one
     * uppercase character from the ISO basic Latin alphabet (A to Z).
     *
Default value: false
     *
     * @param requireUppercaseCharacters Specifies whether IAM user passwords must contain at least one
     *         uppercase character from the ISO basic Latin alphabet (A to Z).
     *
Default value: false
     */
    public void setRequireUppercaseCharacters(Boolean requireUppercaseCharacters) {
        this.requireUppercaseCharacters = requireUppercaseCharacters;
    }

    /**
     * Specifies whether IAM user passwords must contain at least one
     * uppercase character from the ISO basic Latin alphabet (A to Z).
     *
Default value: false
     *

     * Returns a reference to this object so that method calls can be chained together.
     *
     * @param requireUppercaseCharacters Specifies whether IAM user passwords must contain at least one
     *         uppercase character from the ISO basic Latin alphabet (A to Z).
     *
Default value: false
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public UpdateAccountPasswordPolicyRequest withRequireUppercaseCharacters(Boolean requireUppercaseCharacters) {
        this.requireUppercaseCharacters = requireUppercaseCharacters;
        return this;
    }

    /**
     * Specifies whether IAM user passwords must contain at least one
     * uppercase character from the ISO basic Latin alphabet (A to Z).
     *
Default value: false
     *
     * @return Specifies whether IAM user passwords must contain at least one
     *         uppercase character from the ISO basic Latin alphabet (A to Z).
     *
Default value: false
     */
    public Boolean getRequireUppercaseCharacters() {
        return requireUppercaseCharacters;
    }

    /**
     * Specifies whether IAM user passwords must contain at least one
     * lowercase character from the ISO basic Latin alphabet (a to z).
     *
Default value: false
     *
     * @return Specifies whether IAM user passwords must contain at least one
     *         lowercase character from the ISO basic Latin alphabet (a to z).
     *
Default value: false
     */
    public Boolean isRequireLowercaseCharacters() {
        return requireLowercaseCharacters;
    }

    /**
     * Specifies whether IAM user passwords must contain at least one
     * lowercase character from the ISO basic Latin alphabet (a to z).
     *
Default value: false
     *
     * @param requireLowercaseCharacters Specifies whether IAM user passwords must contain at least one
     *         lowercase character from the ISO basic Latin alphabet (a to z).
     *
Default value: false
     */
    public void setRequireLowercaseCharacters(Boolean requireLowercaseCharacters) {
        this.requireLowercaseCharacters = requireLowercaseCharacters;
    }

    /**
     * Specifies whether IAM user passwords must contain at least one
     * lowercase character from the ISO basic Latin alphabet (a to z).
     *
Default value: false
     *

     * Returns a reference to this object so that method calls can be chained together.
     *
     * @param requireLowercaseCharacters Specifies whether IAM user passwords must contain at least one
     *         lowercase character from the ISO basic Latin alphabet (a to z).
     *
Default value: false
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public UpdateAccountPasswordPolicyRequest withRequireLowercaseCharacters(Boolean requireLowercaseCharacters) {
        this.requireLowercaseCharacters = requireLowercaseCharacters;
        return this;
    }

    /**
     * Specifies whether IAM user passwords must contain at least one
     * lowercase character from the ISO basic Latin alphabet (a to z).
     *
Default value: false
     *
     * @return Specifies whether IAM user passwords must contain at least one
     *         lowercase character from the ISO basic Latin alphabet (a to z).
     *
Default value: false
     */
    public Boolean getRequireLowercaseCharacters() {
        return requireLowercaseCharacters;
    }

    /**
     * Allows all IAM users in your account to use the AWS Management Console
     * to change their own passwords. For more information, see Letting
     * IAM Users Change Their Own Passwords in the Using IAM
     * guide.
Default value: false
     *
     * @return Allows all IAM users in your account to use the AWS Management Console
     *         to change their own passwords. For more information, see Letting
     *         IAM Users Change Their Own Passwords in the Using IAM
     *         guide.
Default value: false
     */
    public Boolean isAllowUsersToChangePassword() {
        return allowUsersToChangePassword;
    }

    /**
     * Allows all IAM users in your account to use the AWS Management Console
     * to change their own passwords. For more information, see Letting
     * IAM Users Change Their Own Passwords in the Using IAM
     * guide.
Default value: false
     *
     * @param allowUsersToChangePassword Allows all IAM users in your account to use the AWS Management Console
     *         to change their own passwords. For more information, see Letting
     *         IAM Users Change Their Own Passwords in the Using IAM
     *         guide.
Default value: false
     */
    public void setAllowUsersToChangePassword(Boolean allowUsersToChangePassword) {
        this.allowUsersToChangePassword = allowUsersToChangePassword;
    }

    /**
     * Allows all IAM users in your account to use the AWS Management Console
     * to change their own passwords. For more information, see Letting
     * IAM Users Change Their Own Passwords in the Using IAM
     * guide.
Default value: false
     *

     * Returns a reference to this object so that method calls can be chained together.
     *
     * @param allowUsersToChangePassword Allows all IAM users in your account to use the AWS Management Console
     *         to change their own passwords. For more information, see Letting
     *         IAM Users Change Their Own Passwords in the Using IAM
     *         guide.
Default value: false
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public UpdateAccountPasswordPolicyRequest withAllowUsersToChangePassword(Boolean allowUsersToChangePassword) {
        this.allowUsersToChangePassword = allowUsersToChangePassword;
        return this;
    }

    /**
     * Allows all IAM users in your account to use the AWS Management Console
     * to change their own passwords. For more information, see Letting
     * IAM Users Change Their Own Passwords in the Using IAM
     * guide.
Default value: false
     *
     * @return Allows all IAM users in your account to use the AWS Management Console
     *         to change their own passwords. For more information, see Letting
     *         IAM Users Change Their Own Passwords in the Using IAM
     *         guide.
Default value: false
     */
    public Boolean getAllowUsersToChangePassword() {
        return allowUsersToChangePassword;
    }

    /**
     * The number of days that an IAM user password is valid. The default
     * value of 0 means IAM user passwords never expire.
Default value: 0
     *

     * Constraints:

     * Range: 1 - 1095

     *
     * @return The number of days that an IAM user password is valid. The default
     *         value of 0 means IAM user passwords never expire.
Default value: 0
     */
    public Integer getMaxPasswordAge() {
        return maxPasswordAge;
    }

    /**
     * The number of days that an IAM user password is valid. The default
     * value of 0 means IAM user passwords never expire.
Default value: 0
     *

     * Constraints:

     * Range: 1 - 1095

     *
     * @param maxPasswordAge The number of days that an IAM user password is valid. The default
     *         value of 0 means IAM user passwords never expire.
Default value: 0
     */
    public void setMaxPasswordAge(Integer maxPasswordAge) {
        this.maxPasswordAge = maxPasswordAge;
    }

    /**
     * The number of days that an IAM user password is valid. The default
     * value of 0 means IAM user passwords never expire.
Default value: 0
     *

     * Returns a reference to this object so that method calls can be chained together.
     *

     * Constraints:

     * Range: 1 - 1095

     *
     * @param maxPasswordAge The number of days that an IAM user password is valid. The default
     *         value of 0 means IAM user passwords never expire.
Default value: 0
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public UpdateAccountPasswordPolicyRequest withMaxPasswordAge(Integer maxPasswordAge) {
        this.maxPasswordAge = maxPasswordAge;
        return this;
    }

    /**
     * Specifies the number of previous passwords that IAM users are
     * prevented from reusing. The default value of 0 means IAM users are not
     * prevented from reusing previous passwords.
Default value: 0
     *

     * Constraints:

     * Range: 1 - 24

     *
     * @return Specifies the number of previous passwords that IAM users are
     *         prevented from reusing. The default value of 0 means IAM users are not
     *         prevented from reusing previous passwords.
Default value: 0
     */
    public Integer getPasswordReusePrevention() {
        return passwordReusePrevention;
    }

    /**
     * Specifies the number of previous passwords that IAM users are
     * prevented from reusing. The default value of 0 means IAM users are not
     * prevented from reusing previous passwords.
Default value: 0
     *

     * Constraints:

     * Range: 1 - 24

     *
     * @param passwordReusePrevention Specifies the number of previous passwords that IAM users are
     *         prevented from reusing. The default value of 0 means IAM users are not
     *         prevented from reusing previous passwords.
Default value: 0
     */
    public void setPasswordReusePrevention(Integer passwordReusePrevention) {
        this.passwordReusePrevention = passwordReusePrevention;
    }

    /**
     * Specifies the number of previous passwords that IAM users are
     * prevented from reusing. The default value of 0 means IAM users are not
     * prevented from reusing previous passwords.
Default value: 0
     *

     * Returns a reference to this object so that method calls can be chained together.
     *

     * Constraints:

     * Range: 1 - 24

     *
     * @param passwordReusePrevention Specifies the number of previous passwords that IAM users are
     *         prevented from reusing. The default value of 0 means IAM users are not
     *         prevented from reusing previous passwords.
Default value: 0
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public UpdateAccountPasswordPolicyRequest withPasswordReusePrevention(Integer passwordReusePrevention) {
        this.passwordReusePrevention = passwordReusePrevention;
        return this;
    }

    /**
     * Prevents IAM users from setting a new password after their password
     * has expired.
Default value: false
     *
     * @return Prevents IAM users from setting a new password after their password
     *         has expired.
Default value: false
     */
    public Boolean isHardExpiry() {
        return hardExpiry;
    }

    /**
     * Prevents IAM users from setting a new password after their password
     * has expired.
Default value: false
     *
     * @param hardExpiry Prevents IAM users from setting a new password after their password
     *         has expired.
Default value: false
     */
    public void setHardExpiry(Boolean hardExpiry) {
        this.hardExpiry = hardExpiry;
    }

    /**
     * Prevents IAM users from setting a new password after their password
     * has expired.
Default value: false
     *

     * Returns a reference to this object so that method calls can be chained together.
     *
     * @param hardExpiry Prevents IAM users from setting a new password after their password
     *         has expired.
Default value: false
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public UpdateAccountPasswordPolicyRequest withHardExpiry(Boolean hardExpiry) {
        this.hardExpiry = hardExpiry;
        return this;
    }

    /**
     * Prevents IAM users from setting a new password after their password
     * has expired.
Default value: false
     *
     * @return Prevents IAM users from setting a new password after their password
     *         has expired.
Default value: false
     */
    public Boolean getHardExpiry() {
        return hardExpiry;
    }

    /**
     * Returns a string representation of this object; useful for testing and
     * debugging.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getMinimumPasswordLength() != null) sb.append("MinimumPasswordLength: " + getMinimumPasswordLength() + ",");
        if (isRequireSymbols() != null) sb.append("RequireSymbols: " + isRequireSymbols() + ",");
        if (isRequireNumbers() != null) sb.append("RequireNumbers: " + isRequireNumbers() + ",");
        if (isRequireUppercaseCharacters() != null) sb.append("RequireUppercaseCharacters: " + isRequireUppercaseCharacters() + ",");
        if (isRequireLowercaseCharacters() != null) sb.append("RequireLowercaseCharacters: " + isRequireLowercaseCharacters() + ",");
        if (isAllowUsersToChangePassword() != null) sb.append("AllowUsersToChangePassword: " + isAllowUsersToChangePassword() + ",");
        if (getMaxPasswordAge() != null) sb.append("MaxPasswordAge: " + getMaxPasswordAge() + ",");
        if (getPasswordReusePrevention() != null) sb.append("PasswordReusePrevention: " + getPasswordReusePrevention() + ",");
        if (isHardExpiry() != null) sb.append("HardExpiry: " + isHardExpiry() );
        sb.append("}");
        return sb.toString();
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getMinimumPasswordLength() == null) ? 0 : getMinimumPasswordLength().hashCode());
        hashCode = prime * hashCode + ((isRequireSymbols() == null) ? 0 : isRequireSymbols().hashCode());
        hashCode = prime * hashCode + ((isRequireNumbers() == null) ? 0 : isRequireNumbers().hashCode());
        hashCode = prime * hashCode + ((isRequireUppercaseCharacters() == null) ? 0 : isRequireUppercaseCharacters().hashCode());
        hashCode = prime * hashCode + ((isRequireLowercaseCharacters() == null) ? 0 : isRequireLowercaseCharacters().hashCode());
        hashCode = prime * hashCode + ((isAllowUsersToChangePassword() == null) ? 0 : isAllowUsersToChangePassword().hashCode());
        hashCode = prime * hashCode + ((getMaxPasswordAge() == null) ? 0 : getMaxPasswordAge().hashCode());
        hashCode = prime * hashCode + ((getPasswordReusePrevention() == null) ? 0 : getPasswordReusePrevention().hashCode());
        hashCode = prime * hashCode + ((isHardExpiry() == null) ? 0 : isHardExpiry().hashCode());
        return hashCode;
    }

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

        if (obj instanceof UpdateAccountPasswordPolicyRequest == false) return false;
        UpdateAccountPasswordPolicyRequest other = (UpdateAccountPasswordPolicyRequest)obj;

        if (other.getMinimumPasswordLength() == null ^ this.getMinimumPasswordLength() == null) return false;
        if (other.getMinimumPasswordLength() != null && other.getMinimumPasswordLength().equals(this.getMinimumPasswordLength()) == false) return false;
        if (other.isRequireSymbols() == null ^ this.isRequireSymbols() == null) return false;
        if (other.isRequireSymbols() != null && other.isRequireSymbols().equals(this.isRequireSymbols()) == false) return false;
        if (other.isRequireNumbers() == null ^ this.isRequireNumbers() == null) return false;
        if (other.isRequireNumbers() != null && other.isRequireNumbers().equals(this.isRequireNumbers()) == false) return false;
        if (other.isRequireUppercaseCharacters() == null ^ this.isRequireUppercaseCharacters() == null) return false;
        if (other.isRequireUppercaseCharacters() != null && other.isRequireUppercaseCharacters().equals(this.isRequireUppercaseCharacters()) == false) return false;
        if (other.isRequireLowercaseCharacters() == null ^ this.isRequireLowercaseCharacters() == null) return false;
        if (other.isRequireLowercaseCharacters() != null && other.isRequireLowercaseCharacters().equals(this.isRequireLowercaseCharacters()) == false) return false;
        if (other.isAllowUsersToChangePassword() == null ^ this.isAllowUsersToChangePassword() == null) return false;
        if (other.isAllowUsersToChangePassword() != null && other.isAllowUsersToChangePassword().equals(this.isAllowUsersToChangePassword()) == false) return false;
        if (other.getMaxPasswordAge() == null ^ this.getMaxPasswordAge() == null) return false;
        if (other.getMaxPasswordAge() != null && other.getMaxPasswordAge().equals(this.getMaxPasswordAge()) == false) return false;
        if (other.getPasswordReusePrevention() == null ^ this.getPasswordReusePrevention() == null) return false;
        if (other.getPasswordReusePrevention() != null && other.getPasswordReusePrevention().equals(this.getPasswordReusePrevention()) == false) return false;
        if (other.isHardExpiry() == null ^ this.isHardExpiry() == null) return false;
        if (other.isHardExpiry() != null && other.isHardExpiry().equals(this.isHardExpiry()) == false) return false;
        return true;
    }

    @Override
    public UpdateAccountPasswordPolicyRequest clone() {

            return (UpdateAccountPasswordPolicyRequest) super.clone();
    }

}


text:
package com.clarity.business;

import static org.junit.Assert.assertEquals;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

import org.junit.Test;

import com.in28minutes.junit.business.ClientBO;
import com.in28minutes.junit.business.ClientBOImpl;
import com.in28minutes.junit.business.exception.DifferentCurrenciesException;
import com.in28minutes.junit.model.Amount;
import com.in28minutes.junit.model.AmountImpl;
import com.in28minutes.junit.model.Currency;
import com.in28minutes.junit.model.Product;
import com.in28minutes.junit.model.ProductImpl;
import com.in28minutes.junit.model.ProductType;

public class ClientBOTestRefactored {

	private ClientBO clientBO = new ClientBOImpl();

	@Test
	public void testClientProductSum_AllProductsSameCurrency()
			throws DifferentCurrenciesException {

		Amount[] amounts = {
				new AmountImpl(new BigDecimal("5.0"), Currency.EURO),
				new AmountImpl(new BigDecimal("6.0"), Currency.EURO) };

		Amount expected = new AmountImpl(new BigDecimal("11.0"), Currency.EURO);

		List<Product> products = createProductListWithAmounts(amounts);

		Amount actual = clientBO.getClientProductsSum(products);

		assertAmount(actual, expected);
	}

	@Test(expected = DifferentCurrenciesException.class)
	public void testClientProductSum_DifferentCurrencies_ThrowsException()
			throws DifferentCurrenciesException {

		Amount[] amounts = {
				new AmountImpl(new BigDecimal("5.0"), Currency.EURO),
				new AmountImpl(new BigDecimal("6.0"), Currency.INDIAN_RUPEE) };

		List<Product> products = createProductListWithAmounts(amounts);

		@SuppressWarnings("unused")
		Amount actual = clientBO.getClientProductsSum(products);

	}

	@Test
	public void testClientProductSum_NoProducts()
			throws DifferentCurrenciesException {

		Amount[] amounts = {};
		Amount expected = new AmountImpl(BigDecimal.ZERO, Currency.EURO);

		List<Product> products = createProductListWithAmounts(amounts);

		Amount actual = clientBO.getClientProductsSum(products);

		assertAmount(actual, expected);
	}

	private void assertAmount(Amount actual, Amount expected) {
		assertEquals(expected.getCurrency(), actual.getCurrency());
		assertEquals(expected.getValue(), actual.getValue());
	}

	private List<Product> createProductListWithAmounts(Amount[] amounts) {
		List<Product> products = new ArrayList<Product>();
		for (Amount amount : amounts) {
			products.add(new ProductImpl(100, "Product 15",
					ProductType.BANK_GUARANTEE, amount));
		}
		return products;
	}

}


text:
/*
 * Minio Client (C) 2015 Minio, Inc.
 *
 * Licensed 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.
 */

package main

import (
	"bytes"
	"io/ioutil"
	"os"
	"path/filepath"
	"strconv"

	"github.com/minio/mc/pkg/console"
	"github.com/minio/minio-xl/pkg/probe"
	. "gopkg.in/check.v1"
)

func (s *TestSuite) TestLSContext(c *C) {
	/// filesystem
	root, err := ioutil.TempDir(os.TempDir(), "cmd-")
	c.Assert(err, IsNil)
	defer os.RemoveAll(root)

	var perr *probe.Error
	for i := 0; i < 10; i++ {
		objectPath := filepath.Join(root, "object"+strconv.Itoa(i))
		data := "hello"
		dataLen := len(data)
		perr = putTarget(objectPath, int64(dataLen), bytes.NewReader([]byte(data)))
		c.Assert(perr, IsNil)
	}

	for i := 0; i < 10; i++ {
		objectPath := server.URL + "/bucket/object" + strconv.Itoa(i)
		data := "hello"
		dataLen := len(data)
		perr := putTarget(objectPath, int64(dataLen), bytes.NewReader([]byte(data)))
		c.Assert(perr, IsNil)
	}

	err = app.Run([]string{os.Args[0], "ls", root})
	c.Assert(err, IsNil)
	c.Assert(console.IsError, Equals, false)

	// reset back
	console.IsExited = false

	err = app.Run([]string{os.Args[0], "ls", root + "..."})
	c.Assert(err, IsNil)
	c.Assert(console.IsError, Equals, false)

	// reset back
	console.IsExited = false

	err = app.Run([]string{os.Args[0], "ls", server.URL + "/bucket"})
	c.Assert(err, IsNil)
	c.Assert(console.IsError, Equals, false)

	// reset back
	console.IsExited = false

	err = app.Run([]string{os.Args[0], "ls", server.URL + "/bucket..."})
	c.Assert(err, IsNil)
	c.Assert(console.IsError, Equals, false)

	// reset back
	console.IsExited = false

	err = app.Run([]string{os.Args[0], "ls", server.URL + "/invalid"})
	c.Assert(err, IsNil)
	c.Assert(console.IsExited, Equals, true)

	// reset back
	console.IsExited = false
}


text:
package com.yahoo.omid.tso;

import static com.yahoo.omid.committable.hbase.HBaseCommitTable.COMMIT_TABLE_DEFAULT_NAME;
import static com.yahoo.omid.metrics.CodahaleMetricsProvider.DEFAULT_CODAHALE_METRICS_CONFIG;
import static com.yahoo.omid.timestamp.storage.ZKTimestampStorage.DEFAULT_ZK_CLUSTER;
import static com.yahoo.omid.tso.PersistenceProcessorImpl.DEFAULT_BATCH_PERSIST_TIMEOUT_MS;
import static com.yahoo.omid.tso.PersistenceProcessorImpl.DEFAULT_MAX_BATCH_SIZE;
import static com.yahoo.omid.tso.RequestProcessorImpl.DEFAULT_MAX_ITEMS;
import static com.yahoo.omid.tso.hbase.HBaseTimestampStorage.TIMESTAMP_TABLE_DEFAULT_NAME;

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

import com.beust.jcommander.IVariableArity;
import com.beust.jcommander.JCommander;
import com.beust.jcommander.Parameter;
import com.beust.jcommander.ParametersDelegate;
import com.yahoo.omid.committable.hbase.HBaseLogin;
import com.yahoo.omid.metrics.MetricsProvider;
import com.yahoo.omid.tsoclient.TSOClient;

/**
 * Holds the configuration parameters of a TSO server instance.
 */
public class TSOServerCommandLineConfig extends JCommander implements IVariableArity {

    public enum TimestampStore {
        MEMORY, HBASE, ZK
    };

    public enum CommitTableStore {
        MEMORY, HBASE
    };

    TSOServerCommandLineConfig() {
        this(new String[] {});
    }

    TSOServerCommandLineConfig(String[] args) {
        super();
        addObject(this);
        parse(args);
        setProgramName(TSOServer.class.getName());
    }

    // used for testing
    static public TSOServerCommandLineConfig configFactory(int port, int maxItems) {
        TSOServerCommandLineConfig config = new TSOServerCommandLineConfig();
        config.port = port;
        config.maxItems = maxItems;
        return config;
    }

    static public TSOServerCommandLineConfig parseConfig(String args[]) {
        return new TSOServerCommandLineConfig(args);
    }

    @Parameter(names="-help", description = "Print command options and exit", help = true)
    private boolean help = false;

    @Parameter(names = "-timestampStore", description = "Available stores, MEMORY, HBASE, ZK")
    private TimestampStore timestampStore = TimestampStore.MEMORY;

    @Parameter(names = "-zkCluster", description = "Zookeeper cluster in form: <host>:<port>,<host>,<port>,...)")
    private String zkCluster = DEFAULT_ZK_CLUSTER;

    @Parameter(names = "-commitTableStore", description = "Available stores, MEMORY, HBASE")
    private CommitTableStore commitTableStore = CommitTableStore.MEMORY;

    @Parameter(names = "-hbaseTimestampTable", description = "HBase timestamp table name")
    private String hbaseTimestampTable = TIMESTAMP_TABLE_DEFAULT_NAME;

    @Parameter(names = "-hbaseCommitTable", description = "HBase commit table name")
    private String hbaseCommitTable = COMMIT_TABLE_DEFAULT_NAME;

    @Parameter(names = "-port", description = "Port reserved by the Status Oracle")
    private int port = TSOClient.DEFAULT_TSO_PORT;

    @Parameter(names = "-metricsProvider", description = "Metrics provider: CODAHALE")
    private MetricsProvider.Provider metricsProvider = MetricsProvider.Provider.CODAHALE;

    @Parameter(names = "-metricsConfigs", description = "Metrics config", variableArity = true)
    private List<String> metricsConfigs = new ArrayList<String>(Arrays.asList(DEFAULT_CODAHALE_METRICS_CONFIG));

    @Parameter(names = "-maxItems", description = "Maximum number of items in the TSO (will determine the 'low watermark')")
    private int maxItems = DEFAULT_MAX_ITEMS;

    @Parameter(names = "-maxBatchSize", description = "Maximum size in each persisted batch of commits")
    private int maxBatchSize = DEFAULT_MAX_BATCH_SIZE;

    @Parameter(names = "-batchPersistTimeout", description = "Number of milliseconds the persist processer will wait without new input before flushing a batch")
    private int batchPersistTimeoutMS = DEFAULT_BATCH_PERSIST_TIMEOUT_MS;

    // TODO This is probably going to be temporary. So, we should remove it later if not required. Otherwise
    // we should make it private and provide accessors as is done with the other parameters
    @Parameter(names = "-publishHostAndPortInZK", description = "Publishes the host:port of this TSO server in ZK")
    public boolean shouldHostAndPortBePublishedInZK = false;

    @Parameter(names = "-networkIface", description = "Network Interface where TSO is attached to (e.g. eth0, en0...)")
    private String networkIfaceName = TSOServer.DEFAULT_TSO_NET_IFACE;

    @ParametersDelegate
    private HBaseLogin.Config loginFlags = new HBaseLogin.Config();

    @Override
    public int processVariableArity(String optionName,
                                    String[] options) {
        int i = 0;
        for (String o: options) {
            if (o.startsWith("-")) {
                return i;
            }
            i++;
        }
        return i;
    }

    public boolean hasHelpFlag() {
        return help;
    }

    public TimestampStore getTimestampStore() {
        return timestampStore;
    }

    public String getZKCluster() {
        return zkCluster;
    }

    public CommitTableStore getCommitTableStore() {
        return commitTableStore;
    }

    public String getHBaseTimestampTable() {
        return hbaseTimestampTable;
    }

    public String getHBaseCommitTable() {
        return hbaseCommitTable;
    }

    public int getPort() {
        return port;
    }

    public MetricsProvider.Provider getMetricsProvider() {
        return metricsProvider;
    }

    public List<String> getMetricsConfigs() {
        return metricsConfigs;
    }

    public int getMaxItems() {
        return maxItems;
    }

    public int getMaxBatchSize() {
        return maxBatchSize;
    }

    public int getBatchPersistTimeoutMS() {
        return batchPersistTimeoutMS;
    }

    public HBaseLogin.Config getLoginFlags() { return loginFlags; }

    public String getNetworkIface() {
        return networkIfaceName;
    }

}


text:
<?php

namespace Oro\Bundle\EmailBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use JMS\Serializer\Annotation as JMS;
use BeSimple\SoapBundle\ServiceDefinition\Annotation as Soap;

/**
 * An Email Origin which can be used for emails sent by BAP
 *
 * @ORM\Entity
 * @ORM\HasLifecycleCallbacks()
 */
class InternalEmailOrigin extends EmailOrigin
{
    const BAP = 'BAP';

    const MAILBOX_NAME = 'Local';

    /**
     * @var string
     *
     * @ORM\Column(name="internal_name", type="string", length=30)
     * @Soap\ComplexType("string")
     * @JMS\Type("string")
     */
    protected $internalName;

    /**
     * Get an internal email origin name.
     *
     * @return string
     */
    public function getName()
    {
        return $this->internalName;
    }

    /**
     * Set an internal email origin name
     *
     * @param string $name
     * @return $this
     */
    public function setName($name)
    {
        $this->internalName = $name;

        return $this;
    }

    /**
     * Get a human-readable representation of this object.
     *
     * @return string
     */
    public function __toString()
    {
        return sprintf('Internal - %s', $this->internalName);
    }

    /**
     * @ORM\PrePersist
     */
    public function beforeSave()
    {
        if ($this->mailboxName === null) {
            $this->mailboxName = self::MAILBOX_NAME;
        }
    }
}