### Question:
PropertiesHolder implements IHasProperties { @Override public void removeProperties( Set<String> keys ) { if ( keys != null ) { dirty = true; for ( String key : keys ) { properties.remove( key ); } } } PropertiesHolder(); @Override Object getProperty( String key ); String getPropertyAsString( String key ); @Override void setProperty( String key, Object value ); @Override Object removeProperty( String key ); @Override Set<String> getPropertyKeys(); @Override Map<String, Object> getProperties(); @Override void setProperties( Map<String, Object> props ); @Override void removeProperties( Set<String> keys ); @Override void clearProperties(); @Override boolean containsKey( String key ); @Override boolean isDirty(); @Override void setDirty( boolean dirty ); @Override String toString();  }### Answer:
@Test public void testRemoveProperties_noKeys() throws Exception { Map<String, Object> spyProps = spy( props.properties ); props.removeProperties( null ); verify( spyProps, never() ).remove( anyString() ); }
@Test public void testRemoveProperties() throws Exception { Map<String, Object> setProps = new HashMap<String, Object>( 3 ); setProps.put( "a", 1 ); setProps.put( "b", 2 ); setProps.put( "c", 3 ); props.setProperties( setProps ); Map<String, Object> getProps = props.getProperties(); assertEquals( getProps.size(), 3 ); Set<String> removeProps = new HashSet<String>( 2 ); removeProps.add( "a" ); removeProps.add( "c" ); props.removeProperties( removeProps ); assertEquals( getProps.size(), 1 ); assertTrue( getProps.containsKey( "b" ) ); assertEquals( getProps.get( "b" ), 2 ); }