Iterator<String> () { final String prefix = getPropertyPrefixValue(); final Iterator<String> delegate = buildProperties().keySet().iterator(); if (prefix == null) { return delegate; } return new Iterator<>() { @Override public boolean hasNext() { return delegate.hasNext(); } @Override public String next() { return prefix + delegate.next(); } @Override public void remove() { delegate.remove(); } }; }