### Question:
CouplingFilterUtils { static boolean matchCoupling(final CouplingFilter filter, final MethodCoupling coupling) { return matchString(filter.getSourcePackagePattern(), coupling.getSource().getPackageName()) && matchString(filter.getSourceClassPattern(), coupling.getSource().getSimpleClassName()) && matchString(filter.getSourceMethodPattern(), coupling.getSource().getMethodName()) && matchString(filter.getTargetPackagePattern(), coupling.getTarget().getPackageName()) && matchString(filter.getTargetClassPattern(), coupling.getTarget().getSimpleClassName()) && matchString(filter.getTargetMethodPattern(), coupling.getTarget().getMethodName()); } private  CouplingFilterUtils(); static boolean filterMethodCoupling(final CouplingFilterConfig couplingFilterConfig,
                                               final MethodCoupling coupling);  }### Answer:
@Test public void testMatchCoupling_targetPackage() { assertThat(matchCoupling(new CouplingFilter.Builder().targetPackage("[\\w\\.]+").build(), DEFAULT_COUPLING)).isTrue(); assertThat(matchCoupling(new CouplingFilter.Builder().targetPackage("\\d+").build(), DEFAULT_COUPLING)).isFalse(); }
@Test public void testMatchCoupling_targetClass() { assertThat(matchCoupling(new CouplingFilter.Builder().targetClass("\\w+").build(), DEFAULT_COUPLING)).isTrue(); assertThat(matchCoupling(new CouplingFilter.Builder().targetClass("\\d+").build(), DEFAULT_COUPLING)).isFalse(); }
@Test public void testMatchCoupling_targetMethod() { assertThat(matchCoupling(new CouplingFilter.Builder().targetMethod("\\w+").build(), DEFAULT_COUPLING)).isTrue(); assertThat(matchCoupling(new CouplingFilter.Builder().targetMethod("\\d+").build(), DEFAULT_COUPLING)).isFalse(); }
@Test public void testMatchCoupling() { assertThat(matchCoupling(new CouplingFilter.Builder().build(), DEFAULT_COUPLING)).isTrue(); assertThat(matchCoupling(new CouplingFilter.Builder() .sourcePackage("[\\w\\.]+") .sourceClass("\\w+") .sourceMethod("\\w+") .targetPackage("[\\w\\.]+") .targetClass("\\w+") .targetMethod("\\w+") .build(), DEFAULT_COUPLING)).isTrue(); assertThat(matchCoupling(new CouplingFilter.Builder() .sourcePackage("\\d+") .sourceClass("\\d+") .sourceMethod("\\d+") .targetPackage("\\d+") .targetClass("\\d+") .targetMethod("\\d+") .build(), DEFAULT_COUPLING)).isFalse(); }
@Test public void testMatchCoupling_sourcePackage() { assertThat(matchCoupling(new CouplingFilter.Builder().sourcePackage("[\\w\\.]+").build(), DEFAULT_COUPLING)).isTrue(); assertThat(matchCoupling(new CouplingFilter.Builder().sourcePackage("\\d+").build(), DEFAULT_COUPLING)).isFalse(); }
@Test public void testMatchCoupling_sourceClass() { assertThat(matchCoupling(new CouplingFilter.Builder().sourceClass("\\w+").build(), DEFAULT_COUPLING)).isTrue(); assertThat(matchCoupling(new CouplingFilter.Builder().sourceClass("\\d+").build(), DEFAULT_COUPLING)).isFalse(); }
@Test public void testMatchCoupling_sourceMethod() { assertThat(matchCoupling(new CouplingFilter.Builder().sourceMethod("\\w+").build(), DEFAULT_COUPLING)).isTrue(); assertThat(matchCoupling(new CouplingFilter.Builder().sourceMethod("\\d+").build(), DEFAULT_COUPLING)).isFalse(); }