public Properties apply(final Properties properties) {
    if (properties == null) {
      throw new IllegalArgumentException("properties must not be null");
    } else {
      if (properties.isEmpty()) {
        return new Properties();
      } else {
        final Properties filtered = new Properties();
        for (Map.Entry<Object, Object> entry : properties.entrySet()) {
          final Object key = entry.getKey();
          final Object value = entry.getValue();
          if (!keysToRemove.contains(key)) {
            filtered.put(key, value);
          }
        }
        return filtered;
      }
    }
  }
@Test
  public void filtersMatchingKeys() {
    // Given
    Properties properties = new Properties();
    properties.put("one", 1);
    properties.put("two", 2);
    properties.put("three", 3);
    properties.put("four", 4);
    properties.put("five", 5);
    Set<String> removeAllKeys = new HashSet<>();
    for (Object key : properties.keySet()) {
      removeAllKeys.add(key.toString());
    }
    Filter f = new Filter(removeAllKeys);

    // When
    Properties filtered = f.apply(properties);

    // Then
    assertEquals(0, filtered.size());
  }