### Question:
ProviderType extends AbstractPluginSpecification { public PluginFields groupFields(Map<String, Object> input) { PluginFields.Builder builder = PluginFields.builder(); Map<String, FieldSchema> adminFields = getParametersSpecification(ParameterType.ADMIN).getFields(); Map<String, FieldSchema> userFields = getParametersSpecification(ParameterType.USER).getFields(); for (Map.Entry<String, Object> entry : input.entrySet()) { String field = entry.getKey(); Object fieldVal = entry.getValue(); FieldSchema fieldSchema = adminFields.get(field); if (fieldSchema == null || !fieldSchema.isOverride()) { fieldSchema = userFields.get(field); } if (fieldSchema != null) { if (fieldSchema.isSensitive()) { builder.putSensitive(field, fieldVal); } else { builder.putNonsensitive(field, fieldVal); } } else { LOG.info("Ignoring field {} as its not an overridable admin field or user field.", field); } } return builder.build(); } private  ProviderType(BaseEntity.Builder baseBuilder,
                      Map<ParameterType, ParametersSpecification> parameters,
                      Map<String, ResourceTypeSpecification> resourceTypes); PluginFields groupFields(Map<String, Object> input); static Builder builder();  }### Answer:
@Test public void testGroupFields() { ProviderType providerType = ProviderType.builder() .setParameters(ImmutableMap.of( ParameterType.ADMIN, new ParametersSpecification( ImmutableMap.of( "region", FieldSchema.builder() .setLabel("region") .setType("text") .setOverride(true) .setSensitive(false) .build(), "account", FieldSchema.builder() .setLabel("account") .setType("text") .setOverride(false) .setSensitive(false) .build(), "url", FieldSchema.builder() .setLabel("url") .setType("text") .setOverride(true) .setSensitive(true) .build()), ImmutableSet.<Set<String>>of() ), ParameterType.USER, new ParametersSpecification( ImmutableMap.of( "keyname", FieldSchema.builder() .setLabel("keyname") .setType("text") .setSensitive(false) .build(), "key", FieldSchema.builder() .setLabel("key") .setType("text") .setSensitive(true) .build()), ImmutableSet.<Set<String>>of(ImmutableSet.of("keyname", "key")) ))) .setName("providertype") .build(); Map<String, String> expectedSensitive = ImmutableMap.of("key", "keycontents", "url", "abc.com/api"); Map<String, String> expectedNonsensitive = ImmutableMap.of("keyname", "dev", "region", "iad"); Map<String, Object> input = Maps.newHashMap(); input.putAll(expectedSensitive); input.putAll(expectedNonsensitive); input.put("account", "asdf"); input.put("boguskey", "bogusval"); PluginFields pluginFields = providerType.groupFields(input); Assert.assertEquals(expectedSensitive, pluginFields.getSensitive()); Assert.assertEquals(expectedNonsensitive, pluginFields.getNonsensitive()); }