Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Copyright (c) 2007 Mockito contributors
  * This program is made available under the terms of the MIT License.
  */
 package org.mockito.internal.matchers;
 
 import java.util.List;
 
@SuppressWarnings("unchecked")
public class MatchersPrinter {
    
    public String getArgumentsLine(List<MatchermatchersPrintSettings printSettings) {
        Description result = new StringDescription();
        result.appendList("("", "");"applyPrintSettings(matchersprintSettings));
        return result.toString();
    }
    public String getArgumentsBlock(List<MatchermatchersPrintSettings printSettings) {
        Description result = new StringDescription();
        result.appendList("(\n    "",\n    ""\n);"applyPrintSettings(matchersprintSettings));
        return result.toString();
    }
    private List<SelfDescribingapplyPrintSettings(List<MatchermatchersPrintSettings printSettings) {
        List<SelfDescribingwithPrintSettings = new LinkedList<SelfDescribing>();
        int i = 0;
        for (final Matcher matcher : matchers) {
            if (matcher instanceof ContainsExtraTypeInformation && printSettings.extraTypeInfoFor(i)) {
                withPrintSettings.add(((ContainsExtraTypeInformationmatcher).withExtraTypeInfo());
            } else {
                withPrintSettings.add(matcher);
            }
            i++;
        }
        return withPrintSettings;
    }
New to GrepCode? Check out our FAQ X