public TungstenProperties subset(String prefix,boolean removePrefix,boolean removeProps){
  TungstenProperties tp=new TungstenProperties();
  Set<String> prefixKeys=keyNames(prefix);
  int nameIndex=0;
  if (removePrefix)   nameIndex=prefix.length();
  for (  String key : prefixKeys) {
    String newKey=key.substring(nameIndex);
    if (newKey.length() > 0)     tp.setObject(newKey,getObject(key));
    if (removeProps)     remove(key);
  }
  return tp;
}

public TungstenProperties subset ( String prefix , boolean removePrefix , boolean removeProps ) { TungstenProperties tp = new TungstenProperties ( ) ; Set < String > prefixKeys = keyNames ( prefix ) ; int nameIndex = 0 ; if ( removePrefix ) nameIndex = prefix . length ( ) ; for ( String key : prefixKeys ) { String newKey = key . substring ( nameIndex ) ; if ( newKey . length ( ) > 0 ) tp . setObject ( newKey , getObject ( key ) ) ; if ( removeProps ) remove ( key ) ; } return tp ; }
returns a tungstenproperties instance consisting of the property names that match the given prefix
