# RadioButton

![](/files/-Lc1WwOWOUW-wEApBQkA)

* Componente panelAddRadio requiere una lista de Radio()
* La clase radio se compone de una lista de items.

![](/files/-Lc1WwOYj5IGOvXSt8mI)

## **Codigo**

```java
@Test
    public String radio() {
        try {
            //titulo de la tabla
            List<Color> colorList = colorRepository.findAll();
            Boolean found = unitTest.assertFalse(nameOfMethod(), colorList.isEmpty());
            if (found) {

               unitTest.form();
               unitTest.formTitle("Radio");
              unitTest.panel();

               unitTest.panelAddRadio(Arrays.asList(new Radio("sexo",
                        Arrays.asList(new Item("sexo", "Masculino", "Masculino"),
                                new Item("sexo", "Femenino", "Femenino")))));

             unitTest.panelClose();
              unitTest.formClose();

            } else {
            unitTest.errorMessage("No tiene registros");
            }


        } catch (Exception e) {
            System.out.println(nameOfMethod()+" " + e.getLocalizedMessage());
        }
        return "";
    }
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://avbravo-2.gitbook.io/jmoordbunit/testing-con-unitview/radiobutton.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
