1 /* 2 * Copyright (c) 2007 Mockito contributors 3 * This program is made available under the terms of the MIT License. 4 */ 5 package org.mockitousage.junitrunner; 6 7 import org.junit.runner.Description; 8 import org.junit.runner.manipulation.Filter; 9 10 public class Filters { methodNameContains(final String substring)11 public static Filter methodNameContains(final String substring) { 12 return new Filter() { 13 @Override 14 public boolean shouldRun(Description description) { 15 return description.getDisplayName().contains(substring); 16 } 17 18 @Override 19 public String describe() { 20 return null; 21 } 22 }; 23 } 24 } 25