### Question:
ObjectNameFilter implements ObjectFilter { @Override public List<DescribeSObjectResult> filter(List<DescribeSObjectResult> dsrs) { List<DescribeSObjectResult> filteredResult = new ArrayList<DescribeSObjectResult>(); for (DescribeSObjectResult dsr : dsrs) { if (include == objectNames.contains(dsr.getName())) { filteredResult.add(dsr); } } return filteredResult; } ObjectNameFilter(boolean include, Set<String> objectNames);  ObjectNameFilter(boolean include, String... objectNames); @Override List<DescribeSObjectResult> filter(List<DescribeSObjectResult> dsrs); Set<String> getObjectNames(); boolean isInclude();  }### Answer:
@Test public void testBasicIncludeFilter() { DescribeSObjectResult dsrIn = new DescribeSObjectResult(); dsrIn.setName("Object_Name_In__c"); DescribeSObjectResult dsrOut = new DescribeSObjectResult(); dsrOut.setName("Object_Name_Out__c"); List<DescribeSObjectResult> dsrs = new ObjectNameFilter(true, "Object_Name_In__c").filter(Lists.newArrayList(dsrIn, dsrOut)); assertNotNull(dsrs, "An object name filter of a non-null value should be non-null"); assertEquals(dsrs.size(), 1, "Unexpected number of DescribeSObjectResults after object name filter"); assertEquals(dsrs.get(0).getName(), "Object_Name_In__c", "Unexpected DescribeSObjectResult after object name filter"); }
@Test public void testBasicExcludeFilter() { DescribeSObjectResult dsrIn = new DescribeSObjectResult(); dsrIn.setName("Object_Name_In__c"); DescribeSObjectResult dsrOut = new DescribeSObjectResult(); dsrOut.setName("Object_Name_Out__c"); List<DescribeSObjectResult> dsrs = new ObjectNameFilter(false, "Object_Name_Out__c").filter(Lists.newArrayList(dsrIn, dsrOut)); assertNotNull(dsrs, "An object name filter of a non-null value should be non-null"); assertEquals(dsrs.size(), 1, "Unexpected number of DescribeSObjectResults after object name filter"); assertEquals(dsrs.get(0).getName(), "Object_Name_In__c", "Unexpected DescribeSObjectResult after object name filter"); }