### Question:
GrinderProperties extends Properties { public final synchronized GrinderProperties getPropertySubset(String prefix) { final GrinderProperties result = new GrinderProperties(); final Enumeration<?> propertyNames = propertyNames(); while (propertyNames.hasMoreElements()) { final String name = (String)propertyNames.nextElement(); if (name.startsWith(prefix)) { result.setProperty(name.substring(prefix.length()), getProperty(name)); } } return result; } GrinderProperties();  GrinderProperties(File file); final File getAssociatedFile(); final void setAssociatedFile(File file); final void save(); final void saveSingleProperty(String name); final void setErrorWriter(PrintWriter writer); final synchronized GrinderProperties getPropertySubset(String prefix); final int getInt(String propertyName, int defaultValue); final void setInt(String propertyName, int value); final long getLong(String propertyName, long defaultValue); final void setLong(String propertyName, long value); final short getShort(String propertyName, short defaultValue); final void setShort(String propertyName, short value); final double getDouble(String propertyName, double defaultValue); final void setDouble(String propertyName, double value); final boolean getBoolean(String propertyName, boolean defaultValue); final void setBoolean(String propertyName, boolean value); final File getFile(String propertyName, File defaultValue); final File resolveRelativeFile(File file); final void setFile(String propertyName, File value); static final String SCRIPT; static final String LOG_DIRECTORY; static final String CONSOLE_HOST; static final String CONSOLE_PORT; static final File DEFAULT_PROPERTIES; static final File DEFAULT_SCRIPT; }### Answer:
@Test public void testGetPropertySubset() throws Exception { final GrinderProperties all = m_grinderProperties.getPropertySubset(""); assertEquals(all, m_allSet); assertEquals(all.hashCode(), m_allSet.hashCode()); final GrinderProperties none = m_grinderProperties.getPropertySubset("Not there"); assertEquals(0, none.size()); final GrinderProperties prefixSet = m_grinderProperties.getPropertySubset(s_prefix); assertEquals(prefixSet.size(), m_prefixSet.size()); for (Entry<?, ?> entry : prefixSet.entrySet()) { final String key = (String)entry.getKey(); final String value = (String)entry.getValue(); assertEquals(value, m_prefixSet.get(s_prefix + key)); } }